Skip to content

feat: add D1-compatible read model schema#230

Merged
duncanleo merged 6 commits into
codex/d1-migrationfrom
codex/d1-migration-sqlite-schema
Jun 24, 2026
Merged

feat: add D1-compatible read model schema#230
duncanleo merged 6 commits into
codex/d1-migrationfrom
codex/d1-migration-sqlite-schema

Conversation

@duncanleo

Copy link
Copy Markdown
Member

Summary

  • convert the Drizzle read-model schema from Postgres/pg-core to SQLite/D1-compatible sqlite-core declarations
  • replace PostGIS station points with latitude/longitude columns and use SQLite-friendly JSON, timestamp, enum, boolean, and duration storage
  • replace the old Postgres migration history with a fresh SQLite baseline migration and update the migration drift check
  • update the first affected station, public-holiday, and staging code paths plus the active D1 migration plan log

Validation

  • npm run verify

Notes

This is the Phase 2 schema slice in the D1 migration stack. Later stack slices still need to port the remaining raw Postgres SQL in pull workflow, public reads, crowd reports, dispatch, and local scripts.

@coderabbitai

coderabbitai Bot commented Jun 23, 2026

Copy link
Copy Markdown

Important

Review skipped

Auto reviews are disabled on base/target branches other than the default branch.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: a069bdaf-dc5f-4aaf-ae2e-561a5040768a

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/d1-migration-sqlite-schema

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@duncanleo duncanleo marked this pull request as ready for review June 23, 2026 16:21

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 63ec92eeab

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread drizzle.config.ts
Comment thread app/workflows/pull/helpers/stagingSync.ts
Comment thread app/db/schema.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: b95fa69ff5

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/db/schema.ts
Comment thread app/db/schema.ts
Comment thread app/db/schema.ts
Comment thread app/db/schema.ts
Comment thread app/db/schema.ts
Comment thread app/db/schema.ts
Comment thread app/db/schema.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 36b5d72ec2

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/db/schema.ts
Comment thread app/db/schema.ts
Comment thread app/util/crowdReports.ts
Comment thread app/db/schema.ts
Comment thread app/db/schema.ts

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: bfbf74eec4

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread app/util/crowdReports.ts
Comment thread app/util/db.queries.ts
Comment thread app/util/crowdReportDispatch.ts
@duncanleo

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Hooray!

Reviewed commit: 69a795354d

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@duncanleo duncanleo merged commit d0e9c22 into codex/d1-migration Jun 24, 2026
2 checks passed
@duncanleo duncanleo deleted the codex/d1-migration-sqlite-schema branch June 24, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant