mirror of
https://github.com/nestriness/nestri.git
synced 2026-09-20 01:35:19 +03:00
fix(core): declare the claim column the migration adds
The migration adds session.claim_token, but neither the schema nor the
snapshot knew about it. Nothing breaks today because the two agree with
each other; it breaks the moment someone declares the field, because
generate then diffs against a snapshot without it and emits
ALTER TABLE "session" ADD COLUMN "claim_token" text;
which fails on every database the migration has already run against.
Declared with no writer yet, so the schema, the snapshot and the
database say the same thing.
This commit is contained in:
@@ -62,7 +62,17 @@ export const SessionTable = pgTable(
|
||||
timeStarted: utc('time_started'),
|
||||
timeStopped: utc('time_stopped'),
|
||||
/** Why it ended badly, when it did. */
|
||||
errorMessage: text('error_message')
|
||||
errorMessage: text('error_message'),
|
||||
/**
|
||||
* Which attempt holds this run. Null until an agent claims it, and never
|
||||
* cleared afterwards — a terminal row still records who ran it, and a
|
||||
* token that goes back to null lets a dead claim be replayed.
|
||||
*
|
||||
* Nothing writes it yet. It is declared here so the schema, the snapshot
|
||||
* and the database agree; without it the next generated migration adds a
|
||||
* column that already exists and fails wherever it has run once.
|
||||
*/
|
||||
claimToken: text('claim_token')
|
||||
},
|
||||
(t) => [
|
||||
index('session_box_idx').on(t.boxId),
|
||||
|
||||
Reference in New Issue
Block a user