|
4 | 4 | -- Target DEV database: gamefoundry_dev |
5 | 5 | -- Scope: executable grouped table DDL for active Supabase/server API migration. |
6 | 6 | -- Authoritative key values are generated by the server/API layer unless a later DEV-only seed exception explicitly applies. |
7 | | --- Owned tables: game_journey_note_types, game_journey_notes, game_journey_templates, game_journey_items, game_journey_activity |
| 7 | +-- Owned tables: game_journey_completion_metrics, game_journey_note_types, game_journey_notes, game_journey_templates, game_journey_items, game_journey_activity |
| 8 | +CREATE TABLE IF NOT EXISTS game_journey_completion_metrics ( |
| 9 | + key text PRIMARY KEY, |
| 10 | + "bucketKey" text NOT NULL UNIQUE, |
| 11 | + "bucketOrder" integer NOT NULL DEFAULT 0, |
| 12 | + "bucketName" text NOT NULL, |
| 13 | + "friendlyDescription" text NOT NULL, |
| 14 | + "requiredForMvp" boolean NOT NULL DEFAULT false, |
| 15 | + "canSkip" boolean NOT NULL DEFAULT false, |
| 16 | + "plannedCount" integer NOT NULL DEFAULT 0, |
| 17 | + "completedCount" integer NOT NULL DEFAULT 0, |
| 18 | + "active" boolean NOT NULL DEFAULT true, |
| 19 | + "status" text NOT NULL DEFAULT 'active', |
| 20 | + "createdAt" timestamptz NOT NULL DEFAULT now(), |
| 21 | + "updatedAt" timestamptz NOT NULL DEFAULT now(), |
| 22 | + "createdBy" text NOT NULL REFERENCES users(key), |
| 23 | + "updatedBy" text NOT NULL REFERENCES users(key) |
| 24 | +); |
| 25 | + |
| 26 | +CREATE INDEX IF NOT EXISTS idx_game_journey_completion_metrics_active ON game_journey_completion_metrics ("active"); |
| 27 | +CREATE INDEX IF NOT EXISTS idx_game_journey_completion_metrics_status ON game_journey_completion_metrics ("status"); |
| 28 | +CREATE INDEX IF NOT EXISTS idx_game_journey_completion_metrics_createdby ON game_journey_completion_metrics ("createdBy"); |
| 29 | +CREATE INDEX IF NOT EXISTS idx_game_journey_completion_metrics_updatedby ON game_journey_completion_metrics ("updatedBy"); |
| 30 | + |
8 | 31 | CREATE TABLE IF NOT EXISTS game_journey_note_types ( |
9 | 32 | key text PRIMARY KEY, |
10 | 33 | "typeSlug" text, |
|
0 commit comments