Add missing DB migration sql for training data
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
-- SQLite doesn't support DROP COLUMN directly, so we recreate the table
|
||||
CREATE TABLE photo_insights_backup AS SELECT id, file_path, title, summary, generated_at, model_version, is_current FROM photo_insights;
|
||||
DROP TABLE photo_insights;
|
||||
CREATE TABLE photo_insights (
|
||||
id INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
|
||||
file_path TEXT NOT NULL,
|
||||
title TEXT NOT NULL,
|
||||
summary TEXT NOT NULL,
|
||||
generated_at BIGINT NOT NULL,
|
||||
model_version TEXT NOT NULL,
|
||||
is_current BOOLEAN NOT NULL DEFAULT TRUE
|
||||
);
|
||||
INSERT INTO photo_insights SELECT * FROM photo_insights_backup;
|
||||
DROP TABLE photo_insights_backup;
|
||||
@@ -0,0 +1,2 @@
|
||||
ALTER TABLE photo_insights ADD COLUMN training_messages TEXT;
|
||||
ALTER TABLE photo_insights ADD COLUMN approved BOOLEAN;
|
||||
Reference in New Issue
Block a user