@@ -49,7 +49,7 @@ describe("database schema baseline", () => {
4949 name : string ;
5050 } > ;
5151 expect ( sessionColumns . find ( ( column ) => column . name === "resume_id" ) ) . toBeUndefined ( ) ;
52- expect ( sessionColumns . find ( ( column ) => column . name === "transcript_path" ) ) . toBeDefined ( ) ;
52+ expect ( sessionColumns . find ( ( column ) => column . name === "transcript_path" ) ) . toBeUndefined ( ) ;
5353 expect ( sessionColumns . find ( ( column ) => column . name === "title" ) ) . toBeDefined ( ) ;
5454
5555 const indexNames = (
@@ -120,6 +120,32 @@ describe("database schema baseline", () => {
120120 expect ( ( ) => openDatabase ( dbPath ) ) . toThrow ( / L e g a c y d a t a b a s e s c h e m a d e t e c t e d / ) ;
121121 } ) ;
122122
123+ it ( "rejects a legacy database schema that still contains transcript_path" , async ( ) => {
124+ const { openDatabase } = await import ( "./db" ) ;
125+
126+ const db = new DatabaseSync ( dbPath ) ;
127+ db . exec ( `
128+ CREATE TABLE sessions (
129+ id TEXT PRIMARY KEY,
130+ workspace_id TEXT NOT NULL,
131+ terminal_id TEXT NOT NULL,
132+ provider_id TEXT NOT NULL,
133+ capability TEXT NOT NULL,
134+ state TEXT NOT NULL,
135+ started_at INTEGER NOT NULL,
136+ ended_at INTEGER,
137+ last_active_at INTEGER NOT NULL,
138+ completion_percent INTEGER,
139+ error_reason TEXT,
140+ archived BOOLEAN DEFAULT 0,
141+ transcript_path TEXT
142+ );
143+ ` ) ;
144+ db . close ( ) ;
145+
146+ expect ( ( ) => openDatabase ( dbPath ) ) . toThrow ( / L e g a c y d a t a b a s e s c h e m a d e t e c t e d / ) ;
147+ } ) ;
148+
123149 it ( "rejects a legacy database schema that still contains _migrations" , async ( ) => {
124150 const { openDatabase } = await import ( "./db" ) ;
125151
@@ -181,7 +207,6 @@ describe("database schema baseline", () => {
181207 last_active_at INTEGER NOT NULL,
182208 completion_percent INTEGER,
183209 error_reason TEXT,
184- transcript_path TEXT,
185210 archived BOOLEAN DEFAULT 0
186211 );
187212
@@ -264,7 +289,6 @@ describe("database schema baseline", () => {
264289 last_active_at INTEGER NOT NULL,
265290 completion_percent INTEGER,
266291 error_reason TEXT,
267- transcript_path TEXT,
268292 archived BOOLEAN DEFAULT 0
269293 );
270294 ` ) ;
0 commit comments