Files
Hy2026/backend/migrations/0003_demo_schema.surql
T
Rafał Tyński 0a5ef715eb 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.
2026-10-04 01:24:18 +02:00

16 lines
968 B
Plaintext

-- 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 {};