Skip to content

feat(configuration): rename migrations.sectionMarkers to migrations.tool - #1036

Open
psteinroe wants to merge 9 commits into
feat/goose-envsubfrom
feat/migrations-tool
Open

psteinroe wants to merge 9 commits into
feat/goose-envsubfrom
feat/migrations-tool

Conversation

@psteinroe

@psteinroe psteinroe commented Oct 30, 2026 •

Copy link
Copy Markdown
Collaborator

Stacked on #949.

migrations.sectionMarkers selected the migration tool, but its name described one of the things the tool does. Since #993 the setting picks a MigrationTool adapter, which also preprocesses the file (goose's ENVSUB in #949), so the setting is now called what it selects:

{ "migrations": { "migrationsDir": "db/migrations", "tool": "goose" } }

What changed

  • migrations.tool (--migration-tool in the CLI) with the values "dbmate", "goose" and "none" (default). The enum SectionMarkers is now pgls_configuration::migrations::MigrationTool.
  • migrations.sectionMarkers still works as a deprecated alias: it selects the tool if tool isn't set, and tool wins if both are. Its CLI flag --section-markers is hidden but still accepted. PartialConfiguration::deprecations() reports it, so the LSP and the CLI show "migrations.sectionMarkers is deprecated. Use migrations.tool instead." like the deprecated linter.rules.safety settings.
  • MigrationsConfiguration::migration_tool() / PartialMigrationsConfiguration::migration_tool() resolve the two fields, and the settings keep only the resolved tool.
  • just gen-lint regenerated docs/schema.json (both fields refer to MigrationTool, the description of sectionMarkers says it's deprecated), the TS bindings and docs/reference/cli.md. The migrations guide and the docs of banConcurrentIndexCreationInTransaction / banNonTransactionalStatementInTransaction use tool, and the guide mentions the old name.
  • The diagnostic category migrations/sectionMarkers stays, since it's about the marker comments themselves.

Tests

  • pgls_configuration: deserializes_the_tool, section_markers_still_select_the_tool (alone, and tool winning over it), rejects_unknown_tools (both fields), section_markers_are_deprecated.
  • CLI deprecated_section_markers_still_select_the_migration_tool: with "sectionMarkers": "dbmate", check --fix still applies the safe CONCURRENTLY fix in a transaction:false section and prints the deprecation warning.
  • The workspace, LSP and CLI tests that configured sectionMarkers use tool now.
  • cargo test -p pgls_configuration -p pgls_workspace -p pgls_cli -p pgls_lsp, cargo clippy on the touched crates with -D warnings, just gen-lint (tree clean afterwards).

Not covered

  • The WASM package has no migrations configuration (W1), so nothing changes there.

Update: Merged #993's one-model rework, where every tool (Supabase, dbmate, goose, none) is a MigrationTool in pgls_workspace::migrations. Adapted to the rename: the tool's section_markers() is now setting(), which returns the migrations.tool value that selects it, and init writes the detected dbmate project as "tool": "dbmate" instead of the deprecated sectionMarkers (the console says "the migration tool to dbmate"). init_with_dbmate_project_sets_the_migrations_and_the_tool checks it. Not part of this PR: with one model, migrations.tool could 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 maps migrations.tool to the tool. migrations.tool now 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), and init writes "tool": "supabase" for a Supabase project (init_with_supabase_project_sets_the_migrations_dir checks it). For dbmate it writes "tool": "dbmate" as before. just gen-lint regenerated schema.json, the TS bindings and the CLI reference; both guides mention the value.

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
@psteinroe
psteinroe added this pull request to stack #1092 November 1, 2026 09:16
# 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

No deployments
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