The minimalistic document archiving platform.
fix(migrations): added statement breakpoints for prod db (#12)
Corentin THOMASSET7f0d2dcd44ca
diff --git a/apps/papra-server/migrations/0001_supreme_odin.sql b/apps/papra-server/migrations/0001_supreme_odin.sqlindex c6d959b9..7cc1a0cd 100644--- a/apps/papra-server/migrations/0001_supreme_odin.sql+++ b/apps/papra-server/migrations/0001_supreme_odin.sql@@ -1,19 +1,23 @@-- Custom SQL migration file, put your code below! --CREATE VIRTUAL TABLE documents_fts USING fts5(id UNINDEXED, name, original_name, content, content='documents', prefix='2 3 4');+--> statement-breakpoint-- Copy data from documents to documents_fts for existing recordsINSERT INTO documents_fts(id, name, original_name, content)SELECT id, name, original_name, content FROM documents;+--> statement-breakpointCREATE TRIGGER trigger_documents_fts_insert AFTER INSERT ON documents BEGININSERT INTO documents_fts(id, name, original_name, content) VALUES (new.id, new.name, new.original_name, new.content);END;+--> statement-breakpointCREATE TRIGGER trigger_documents_fts_update AFTER UPDATE ON documents BEGININSERT INTO documents_fts(documents_fts, id) VALUES('delete', old.id);INSERT INTO documents_fts(id, name, original_name, content) VALUES (new.id, new.name, new.original_name, new.content);END;+--> statement-breakpointCREATE TRIGGER trigger_documents_fts_delete AFTER DELETE ON documents BEGININSERT INTO documents_fts(documents_fts, id) VALUES('delete', old.id);