polterware/kit

Database and Migrations

Run linked-project workflows safely with Polter and understand the difference between push, lint, reset, and local-reset.

Ops stores its database contract in Supabase migrations. The recommended way to operate that contract is through Polter app workflows that understand the Ops repository layout.

Linking matters because migration commands target a concrete Supabase project. Destructive commands matter even more because they can wipe data if used carelessly.

Linked project workflows

npx polter app link ops --path .
npx polter app migrate ops push --path .

Link first when the repository is not already associated with the correct Supabase project. After that, push applies pending migrations to the linked backend.

Push, lint, reset, and local-reset

CommandDescription
npx polter app migrate ops push --path .Apply pending migrations to the linked remote Supabase project.
npx polter app migrate ops lint --path .Validate migration quality before applying changes.
npx polter app migrate ops reset --path .Destructively reset the linked remote database and then reapply migrations.
npx polter app migrate ops local-reset --path .Destructively reset the local Docker-based database stack used for local Supabase work.

Safety guidance

Remote reset is destructive

Use reset only when you intentionally want to drop user-created entities in the linked remote database. Treat it like an operator action with explicit confirmation and backups.

Local reset is still destructive

local-reset only targets the local Docker stack, but it still destroys local state. Use it when you want a clean local baseline, not as a casual fix.

Confirm the repository points at the correct Supabase project before any migration work.

Lint first when in doubt

Use lint to catch obvious migration issues before pushing or resetting.

Push for normal forward progress

Use push for regular schema evolution.

Reserve reset commands for intentional destructive work

Only use remote reset or local-reset when the data loss is expected and acceptable.

On this page