Repository navigation
Banded migration ids + set-difference runner - #2
Merged
Merged
Conversation
Adds a custom Migrator runner that uses set-difference semantics over effect_sql_migrations instead of the stock max-id strategy, plus a banded-id convention (upstream 1..999, downstream-only >= 5000) so a downstream-only migration cannot silently shadow a future upstream migration during merges. Also lands the first downstream migration, 5001_ProjectionTags, which creates the projection_tags table and adds a tags_json column to projection_projects (DEFAULT '[]'). The MigrationsRunner integration test resets all user tables between sibling it.effect blocks because @effect/vitest's `it.layer` builds the layer with `Effect.cached`, sharing the in-memory SQLite across the suite.
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.
Summary
5001) cannot silently block a future upstream id (e.g.27) from running.1..999, downstream-only>= 5000. Enforced in CI byMigrations.test.ts.5001_ProjectionTags(createsprojection_tags, addstags_jsontoprojection_projectswithDEFAULT '[]').MigrationsRunner.test.tsnow resets all user tables between siblingit.effectblocks because@effect/vitest'sit.layerbuilds the layer withEffect.cached, sharing the in-memory SQLite across the suite.Test plan
bun run typecheckfromapps/servervitest run src/persistence/Migrations.test.ts src/persistence/MigrationsRunner.test.ts src/persistence/Migrations/5001_ProjectionTags.test.ts(7/7 passing under Node 24)5001is recorded ineffect_sql_migrationsandtags_jsonappears onprojection_projects.