Skip to content

Give casbin_admin_template_update its own migration version - #295

Merged
vsilent merged 1 commit into
devfrom
fix/duplicate-migration-version
Oct 16, 2026
Merged

vsilent merged 1 commit into
devfrom
fix/duplicate-migration-version

Conversation

@vsilent

@vsilent vsilent commented Oct 16, 2026

Copy link
Copy Markdown
Collaborator

20261016120000 was used by two migrations: baked_snapshot_server_type (#291, already applied on dev) and casbin_admin_template_update (adb1779). sqlx keys _sqlx_migrations by version, so:

  • every fresh database fails with duplicate key value violates unique constraint "_sqlx_migrations_pkey", and the integration tests cannot start the test app (CI of every PR to dev, e.g. Quick Deploy: metered Managed server billing, no plan gate #294);
  • a database that already applied one of the two refuses the other at boot.

casbin_admin_template_update moves to 20261016191200. It only inserts Casbin rules with ON CONFLICT DO NOTHING, so it is safe to apply again under the new version.

Regression test: migration_boot_contract::every_migration_version_is_used_once. It fails on dev and passes after the rename. The tests that failed in CI (admin_jwt, admin_notifications_bell, agent_command_flow) pass: 21 passed.

🤖 Generated with Claude Code

https://claude.ai/code/session_012TKZy6f5shPzM9WLdswH6f

20261016120000 was used twice: baked_snapshot_server_type (2b9eb5f, in
dev since #291 and applied on dev) and casbin_admin_template_update
(adb1779). sqlx keys _sqlx_migrations by version, so every fresh
database failed with a duplicate key on _sqlx_migrations_pkey and the
integration tests could not start the test app; a database that already
applied one of them refuses the other at boot.

casbin_admin_template_update moves to 20261016191200 (its commit time).
It only inserts Casbin rules with ON CONFLICT DO NOTHING, so applying it
under the new version is safe wherever it already ran.

Regression test (red on dev): migration_boot_contract
every_migration_version_is_used_once. migration_boot_contract 11 passed;
admin_jwt, admin_notifications_bell, agent_command_flow (failing in CI)
21 passed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_012TKZy6f5shPzM9WLdswH6f
@vsilent
vsilent merged commit 645cea8 into dev Oct 16, 2026
10 checks passed
@vsilent vsilent mentioned this pull request Oct 17, 2026
Merged
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.

2 participants