feat(sql): add demo schema additions and synthetic seed data

Add additive schema for demo (user.display_name, innovation.tags, FLEXIBLE free-form fields) and a fully synthetic seed with organizations, personas, problems, submissions, innovations, knowledge items, grant calls, ideas and tester feedback. Verified on SurrealDB 3.2.4: migrations apply cleanly and are idempotent.
This commit is contained in:
Rafał Tyński
2026-10-04 01:24:18 +02:00
parent 6df1027699
commit 0a5ef715eb
3 changed files with 134 additions and 1 deletions
+15
View File
@@ -0,0 +1,15 @@
-- TarninaHub — migration 0003: additive schema for demo/UI
-- Idempotent, additive. Required before the demo seed (0004).
-- Human-friendly label for synthetic demo profiles (never personal data).
DEFINE FIELD IF NOT EXISTS display_name ON TABLE user TYPE option<string>;
-- Innovations are taggable (matchmaking filters), mirroring `problem.tags`.
DEFINE FIELD IF NOT EXISTS tags ON TABLE innovation TYPE array<record<tag>> DEFAULT [];
-- Free-form payloads must be FLEXIBLE (SCHEMAFULL otherwise rejects nested keys).
DEFINE FIELD OVERWRITE contact ON TABLE organization TYPE option<object> FLEXIBLE;
DEFINE FIELD OVERWRITE content ON TABLE application TYPE object FLEXIBLE DEFAULT {};
DEFINE FIELD OVERWRITE media ON TABLE innovation TYPE array<object> FLEXIBLE DEFAULT [];
DEFINE FIELD OVERWRITE attachments ON TABLE knowledge_item TYPE array<object> FLEXIBLE DEFAULT [];
DEFINE FIELD OVERWRITE payload ON TABLE notification TYPE object FLEXIBLE DEFAULT {};