Skip to content

Commit e393091

Browse files
authored
fix(db): prevent sqlite migration crash on sub_chats drop column (#100)
Prevent SQLite migration crash on startup. `0005_marvelous_master_chief.sql` may run `ALTER TABLE sub_chats DROP COLUMN ...` on DBs where these columns never existed, causing `SQLITE_ERROR: no such column` and aborting migrations. Remove the unsafe DROP COLUMN statements (keep index creation). Related: 15ee551 (PR #87) - https://github.com/paul-bouzian/1code/blob/15ee55107f3eefbf012fb9754484f987b9fbf399/drizzle/0005_marvelous_master_chief.sql#L1-L4 - https://github.com/paul-bouzian/1code/blob/15ee55107f3eefbf012fb9754484f987b9fbf399/drizzle/meta/_journal.json#L40-L46
1 parent 0daad3c commit e393091

1 file changed

Lines changed: 1 addition & 4 deletions

File tree

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1 @@
1-
CREATE INDEX `chats_worktree_path_idx` ON `chats` (`worktree_path`);--> statement-breakpoint
2-
ALTER TABLE `sub_chats` DROP COLUMN `additions`;--> statement-breakpoint
3-
ALTER TABLE `sub_chats` DROP COLUMN `deletions`;--> statement-breakpoint
4-
ALTER TABLE `sub_chats` DROP COLUMN `file_count`;
1+
CREATE INDEX `chats_worktree_path_idx` ON `chats` (`worktree_path`);

0 commit comments

Comments
 (0)