From 2d64ee7f9e8b10a41b77a7a285ca7b8679f2059f Mon Sep 17 00:00:00 2001 From: psychedelicious <4822129+psychedelicious@users.noreply.github.com> Date: Fri, 13 Oct 2023 21:48:37 +1100 Subject: [PATCH] Revert "fix(backend): remove logic to create workflows column" This reverts commit 3611029057fb97a7a9e1fbb2e0970ab4b66ffc10. --- .../app/services/image_records/image_records_sqlite.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/invokeai/app/services/image_records/image_records_sqlite.py b/invokeai/app/services/image_records/image_records_sqlite.py index c0783fdf2f..e50138a1c4 100644 --- a/invokeai/app/services/image_records/image_records_sqlite.py +++ b/invokeai/app/services/image_records/image_records_sqlite.py @@ -76,6 +76,16 @@ class SqliteImageRecordStorage(ImageRecordStorageBase): """ ) + if "workflow" not in columns: + self._cursor.execute( + """--sql + ALTER TABLE images + ADD COLUMN workflow_id TEXT; + -- TODO: This requires a migration: + -- FOREIGN KEY (workflow_id) REFERENCES workflows (workflow_id) ON DELETE SET NULL; + """ + ) + # Create the `images` table indices. self._cursor.execute( """--sql