summaryrefslogtreecommitdiff
path: root/makima/migrations/20250110000005_create_placeholder_owners.sql
diff options
context:
space:
mode:
Diffstat (limited to 'makima/migrations/20250110000005_create_placeholder_owners.sql')
-rw-r--r--makima/migrations/20250110000005_create_placeholder_owners.sql18
1 files changed, 18 insertions, 0 deletions
diff --git a/makima/migrations/20250110000005_create_placeholder_owners.sql b/makima/migrations/20250110000005_create_placeholder_owners.sql
new file mode 100644
index 0000000..05c946e
--- /dev/null
+++ b/makima/migrations/20250110000005_create_placeholder_owners.sql
@@ -0,0 +1,18 @@
+-- Create placeholder owners for existing data with hardcoded owner_ids
+-- These will be migrated to real owners when users sign up
+
+-- Note: The existing codebase uses the same UUID (00000000-0000-0000-0000-000000000002)
+-- for both files, tasks, and daemons based on the existing migrations.
+
+-- Placeholder owner for existing legacy data (used in files, tasks, daemons)
+INSERT INTO owners (id, name, owner_type)
+VALUES ('00000000-0000-0000-0000-000000000002', 'Legacy Owner', 'personal')
+ON CONFLICT (id) DO NOTHING;
+
+-- Additional placeholder in case files migration used different ID
+-- (keeping both for backward compatibility)
+INSERT INTO owners (id, name, owner_type)
+VALUES ('00000000-0000-0000-0000-000000000001', 'Legacy Files Owner', 'personal')
+ON CONFLICT (id) DO NOTHING;
+
+COMMENT ON TABLE owners IS 'NOTE: IDs 00000000-0000-0000-0000-00000000000[12] are legacy placeholders';