Repository navigation
app/: one initial schema migration in place of twelve (sc-8900) - #107
Merged
Merged
Conversation
ndbroadbent
force-pushed
the
app-squash-migrations
branch
from
December 3, 2026 03:46
9086a11 to
6e5cc45
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
app/ starts production on a fresh database at cutover, so its twelve migrations become one,
app/database/migrations/0001_01_01_000000_initial_schema.rs. It builds the schema the twelve leave behind.What's in it
laravel::cache::tables!()andlaravel::queue::tables!()), identities, user_tokens, waitlist and project_tokens. The columns the later ALTERs added tousers(the email choices,signup_notified_at,heard_about_*) are now part of the CREATE, still last.blobs.deleting,diffs.used_at,projects.gallery_urlsandcomment_when_unchanged,renders.uploadsandused_at), with their indexes. It also creates gallery_purge_failures, emails, invitations and device_logins, and theeffective_snapshotsview. The comments that explained each column stay as SQL comments.timestamp with time zone. Sousers.signup_notified_atis declared through the builder and then changed to timestamptz by one statement at the top of the SQL, before any row exists. The builder now addsproject_tokens' foreign key to projects, under its old nameproject_tokens_project_id_fkey.tests/scaffold.rsdoesn't name any migration file, so it's unchanged.The two schemas are identical
On agents-build-2: two postgres:17 containers. One was migrated by the binary built with origin/main's twelve migrations, the other by the binary built with this file (
visualci-app migrate --force; both runs include oauth-provider-laravel's four migrations). Then each was dumped:Result: empty (3,464 lines each). The raw
diff old.sql new.sqldiffers only in the two\restrict/\unrestrictlines: pg_dump 17 writes a random key there on every run. Column order wasn't normalised. The columns the ALTERs added stay last, so the dumps match byte for byte.Checks (app/, on agents-build-2, with postgres:17 and rustfs/rustfs:1.0.6 on 59000):
cargo fmt --checkpasses.cargo clippy --locked --all-targets -- -D warningspasses.cargo test --locked: 199 passed, 0 failed, 0 ignored.Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.