Repository navigation
Conversation
sectionMarkers stays as a deprecated alias: it still selects the tool, tool wins if both are set, and using it adds a deprecation notice like the other deprecated settings.
# Conflicts: # crates/pgls_workspace/src/migrations/goose.rs # docs/guides/checking_migrations.md
# Conflicts: # crates/pgls_workspace/src/migrations.rs # crates/pgls_workspace/src/migrations/dbmate.rs # crates/pgls_workspace/src/migrations/goose.rs # crates/pgls_workspace/src/workspace/server.rs # docs/guides/checking_migrations.md
# Conflicts: # crates/pgls_cli/src/commands/init.rs # crates/pgls_migrations/src/detect.rs # crates/pgls_migrations/src/tools/dbmate.rs # crates/pgls_migrations/src/tools/goose.rs # crates/pgls_migrations/src/tools/supabase.rs # crates/pgls_workspace/src/migrations.rs # crates/pgls_workspace/src/workspace/server.rs # docs/guides/checking_migrations.md
init writes "tool": "supabase" for Supabase projects. The Supabase CLI runs every file as one migration, so its files are checked like with "none".
This branch has not been deployed
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.
Stacked on #949.
migrations.sectionMarkersselected the migration tool, but its name described one of the things the tool does. Since #993 the setting picks aMigrationTooladapter, which also preprocesses the file (goose'sENVSUBin #949), so the setting is now called what it selects:{ "migrations": { "migrationsDir": "db/migrations", "tool": "goose" } }What changed
migrations.tool(--migration-toolin the CLI) with the values"dbmate","goose"and"none"(default). The enumSectionMarkersis nowpgls_configuration::migrations::MigrationTool.migrations.sectionMarkersstill works as a deprecated alias: it selects the tool iftoolisn't set, andtoolwins if both are. Its CLI flag--section-markersis hidden but still accepted.PartialConfiguration::deprecations()reports it, so the LSP and the CLI show "migrations.sectionMarkersis deprecated. Usemigrations.toolinstead." like the deprecatedlinter.rules.safetysettings.MigrationsConfiguration::migration_tool()/PartialMigrationsConfiguration::migration_tool()resolve the two fields, and the settings keep only the resolvedtool.just gen-lintregenerateddocs/schema.json(both fields refer toMigrationTool, the description ofsectionMarkerssays it's deprecated), the TS bindings anddocs/reference/cli.md. The migrations guide and the docs ofbanConcurrentIndexCreationInTransaction/banNonTransactionalStatementInTransactionusetool, and the guide mentions the old name.migrations/sectionMarkersstays, since it's about the marker comments themselves.Tests
pgls_configuration:deserializes_the_tool,section_markers_still_select_the_tool(alone, andtoolwinning over it),rejects_unknown_tools(both fields),section_markers_are_deprecated.deprecated_section_markers_still_select_the_migration_tool: with"sectionMarkers": "dbmate",check --fixstill applies the safeCONCURRENTLYfix in atransaction:falsesection and prints the deprecation warning.sectionMarkersusetoolnow.cargo test -p pgls_configuration -p pgls_workspace -p pgls_cli -p pgls_lsp,cargo clippyon the touched crates with-D warnings,just gen-lint(tree clean afterwards).Not covered
Update: Merged #993's one-model rework, where every tool (Supabase, dbmate, goose, none) is a
MigrationToolinpgls_workspace::migrations. Adapted to the rename: the tool'ssection_markers()is nowsetting(), which returns themigrations.toolvalue that selects it, andinitwrites the detected dbmate project as"tool": "dbmate"instead of the deprecatedsectionMarkers(the console says "the migration tool to dbmate").init_with_dbmate_project_sets_the_migrations_and_the_toolchecks it. Not part of this PR: with one model,migrations.toolcould also take"supabase", which would run files like"none"but name the tool. That's a separate change.Update (redesign): Merged #993's redesign (
pgls_migrations, one trait without defaults) and main. The workspace mapsmigrations.toolto the tool.migrations.toolnow also takes"supabase", since Supabase is a tool like the others: it checks files like"none"(the Supabase CLI runs every file as one migration), andinitwrites"tool": "supabase"for a Supabase project (init_with_supabase_project_sets_the_migrations_dirchecks it). For dbmate it writes"tool": "dbmate"as before.just gen-lintregeneratedschema.json, the TS bindings and the CLI reference; both guides mention the value.