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.
16 lines
968 B
Plaintext
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 {};
|