warp_engine 0.5.1: the device_grants migration collided with the host's
ci/woodpecker/push/woodpecker Pipeline failed
ci/woodpecker/tag/woodpecker Pipeline failed

`db:migrate` on the catalog API stopped before running anything:

    Multiple migrations have the version number 20260819000001.

The engine appends its `db/migrate` to the host's migration paths instead of
copying migrations in, so engine and host share one version namespace. Both had
picked 20260819000001 on the same day by the same habit — the engine for
device_grants, apps/api for carry_the_store_config_in_the_registry — and neither
repository could see the other's number.

Worse than a clash of our own making: it takes the *host's* migrations down with
it, for the whole application, before anything runs.

device_grants is renumbered to 20260819093412 — a real second-resolution
timestamp, which is the actual defence. A round hand-written number is precisely
what another repository lands on. Nothing had run it in production, so this is a
rename rather than a data migration; a host that already applied the old version
renumbers its schema_migrations row.

The older engine migrations keep their round numbers: renumbering one that has
been deployed everywhere is worse than the risk it carries. They are named in the
new spec's grandfather list rather than excused by a rule that would also let the
next one through.

That spec found a second thing, older than this change: the install template
creates `application_tokens`, and so does one of our own migrations — so a fresh
host runs CREATE TABLE twice and has to delete the block from its generated copy
by hand, which is exactly what teletype-orbit's migration header describes. I had
just made it worse by putting device_grants in the template too; that is out
again, and the template says why. `application_tokens` is grandfathered and left
for a change that is not a hotfix.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-08-19 11:29:53 +02:00
co-authored by Claude Opus 5
parent 65f337bcf4
commit 066451f31c
6 changed files with 109 additions and 22 deletions
+18
View File
@@ -45,6 +45,24 @@ ActiveRecord::Schema[8.1].define(version: 2026_08_19_120000) do
t.index ["token_digest"], name: "idx_application_tokens_token_digest", unique: true
end
create_table "device_grants", id: { type: :bigint, unsigned: true }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.bigint "application_token_id", unsigned: true
t.datetime "approved_at", precision: 3
t.string "client_name", limit: 128
t.datetime "created_at", precision: 3
t.datetime "denied_at", precision: 3
t.string "device_code", limit: 64, null: false
t.datetime "expires_at", precision: 3, null: false
t.string "issued_token", limit: 64
t.bigint "subject_id", unsigned: true
t.string "subject_type", limit: 128
t.datetime "updated_at", precision: 3
t.string "user_code", limit: 16, null: false
t.index ["device_code"], name: "idx_device_grants_device_code", unique: true
t.index ["expires_at"], name: "idx_device_grants_expires_at"
t.index ["user_code"], name: "idx_device_grants_user_code", unique: true
end
create_table "downloads", id: { type: :bigint, unsigned: true }, charset: "utf8mb4", collation: "utf8mb4_0900_ai_ci", force: :cascade do |t|
t.datetime "created_at", precision: 3
t.datetime "deleted_at", precision: 3