Skip to content

Commit 9d70ac6

Browse files
committed
Clear Site Setup and product-data warnings and add Supabase DEV preflight readiness - PR_26166_135-138-db-auth-readiness
1 parent 7b4ffb3 commit 9d70ac6

33 files changed

Lines changed: 2599 additions & 1321 deletions

docs_build/database/ddl/admin.sql

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,20 @@
22
-- Group: Admin
33
-- Ownership: docs_build/database/ddl/admin.sql
44
-- Target DEV database: gamefoundry_dev
5-
-- Scope: no active persistent Admin tables exist in the Local DB/server API contract yet.
6-
-- Empty-group note: Admin Site Setup owns explicit server-side setup/reseed entry points; no persistent admin table is active.
5+
-- Scope: Admin Site Setup ownership tables.
6+
7+
CREATE TABLE IF NOT EXISTS platform_settings (
8+
key text PRIMARY KEY,
9+
"settingKey" text NOT NULL UNIQUE,
10+
"settingValue" text NOT NULL DEFAULT '',
11+
"settingType" text NOT NULL DEFAULT 'string',
12+
description text NOT NULL DEFAULT '',
13+
"isActive" boolean NOT NULL DEFAULT true,
14+
"createdAt" timestamptz NOT NULL DEFAULT now(),
15+
"updatedAt" timestamptz NOT NULL DEFAULT now(),
16+
"createdBy" text NOT NULL REFERENCES users(key),
17+
"updatedBy" text NOT NULL REFERENCES users(key)
18+
);
19+
20+
CREATE INDEX IF NOT EXISTS idx_platform_settings_createdby ON platform_settings ("createdBy");
21+
CREATE INDEX IF NOT EXISTS idx_platform_settings_updatedby ON platform_settings ("updatedBy");

docs_build/database/ddl/sqlite/local-db-schema-map.sql

Lines changed: 28 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,20 @@ CREATE INDEX IF NOT EXISTS idx_user_roles_updatedby ON "user_roles" ("updatedBy"
5353

5454
-- Group: Admin
5555
-- Grouped DDL source: docs_build/database/ddl/admin.sql
56-
-- No active Local DB runtime tables for this group in the current DEV adapter.
56+
CREATE TABLE IF NOT EXISTS "platform_settings" (
57+
"key" TEXT PRIMARY KEY,
58+
"settingKey" TEXT,
59+
"settingValue" TEXT,
60+
"settingType" TEXT,
61+
"description" TEXT,
62+
"isActive" TEXT,
63+
"createdAt" TEXT,
64+
"updatedAt" TEXT,
65+
"createdBy" TEXT NOT NULL REFERENCES users("key"),
66+
"updatedBy" TEXT NOT NULL REFERENCES users("key")
67+
);
68+
CREATE INDEX IF NOT EXISTS idx_platform_settings_createdby ON "platform_settings" ("createdBy");
69+
CREATE INDEX IF NOT EXISTS idx_platform_settings_updatedby ON "platform_settings" ("updatedBy");
5770

5871
-- Group: Game Workspace
5972
-- Grouped DDL source: docs_build/database/ddl/game-workspace.sql
@@ -601,7 +614,20 @@ CREATE INDEX IF NOT EXISTS idx_toolbox_votes_updatedby ON "toolbox_votes" ("upda
601614

602615
-- Group: Support Tickets
603616
-- Grouped DDL source: docs_build/database/ddl/support-tickets.sql
604-
-- No active Local DB runtime tables for this group in the current DEV adapter.
617+
CREATE TABLE IF NOT EXISTS "support_categories" (
618+
"key" TEXT PRIMARY KEY,
619+
"categorySlug" TEXT,
620+
"name" TEXT,
621+
"description" TEXT,
622+
"isActive" TEXT,
623+
"sortOrder" TEXT,
624+
"createdAt" TEXT,
625+
"updatedAt" TEXT,
626+
"createdBy" TEXT NOT NULL REFERENCES users("key"),
627+
"updatedBy" TEXT NOT NULL REFERENCES users("key")
628+
);
629+
CREATE INDEX IF NOT EXISTS idx_support_categories_createdby ON "support_categories" ("createdBy");
630+
CREATE INDEX IF NOT EXISTS idx_support_categories_updatedby ON "support_categories" ("updatedBy");
605631

606632
-- Group: Tool State Samples
607633
-- Grouped DDL source: Local DB compatibility table; grouped guest seed data is owned under docs_build/database/seed/guest/.

docs_build/database/ddl/support-tickets.sql

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,20 @@
22
-- Group: Support Tickets
33
-- Ownership: docs_build/database/ddl/support-tickets.sql
44
-- Target DEV database: gamefoundry_dev
5-
-- Scope: no active persistent Support Tickets tables exist in the Local DB/server API contract yet.
6-
-- Empty-group note: support ticket tables are not active in the Local DB adapter yet.
5+
-- Scope: Support category setup ownership.
6+
7+
CREATE TABLE IF NOT EXISTS support_categories (
8+
key text PRIMARY KEY,
9+
"categorySlug" text NOT NULL UNIQUE,
10+
name text NOT NULL,
11+
description text NOT NULL DEFAULT '',
12+
"isActive" boolean NOT NULL DEFAULT true,
13+
"sortOrder" integer NOT NULL DEFAULT 1,
14+
"createdAt" timestamptz NOT NULL DEFAULT now(),
15+
"updatedAt" timestamptz NOT NULL DEFAULT now(),
16+
"createdBy" text NOT NULL REFERENCES users(key),
17+
"updatedBy" text NOT NULL REFERENCES users(key)
18+
);
19+
20+
CREATE INDEX IF NOT EXISTS idx_support_categories_createdby ON support_categories ("createdBy");
21+
CREATE INDEX IF NOT EXISTS idx_support_categories_updatedby ON support_categories ("updatedBy");

docs_build/database/dml/DML_INDEX.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ Direct SQL setup is intentionally narrow. Account DEV users are SQL-executable s
1616
| Game Workspace | `game-workspace.sql` | Server-seed-owned | Server-side seed API |
1717
| Objects | `objects.sql` | Server-seed-owned | Server-side seed API |
1818
| Palette | `palette.sql` | Server-seed-owned | Server-side seed API |
19-
| Support Tickets | `support-tickets.sql` | Future/not-yet-owned | No active Local DB support ticket tables |
19+
| Support Tickets | `support-tickets.sql` | Server-seed-owned | Admin Site Setup/server-side seed API |
2020
| Tags | `tags.sql` | Server-seed-owned | Server-side seed API |
2121
| Tool Metadata | `tool-metadata.sql` | Server-seed-owned | Server-side seed API |
2222
| Tool Planning | `tool-planning.sql` | Server-seed-owned | Server-side seed API |
@@ -36,4 +36,3 @@ All non-user records must use server/API-generated ULID-style keys.
3636
## Browser Seed Prohibition
3737

3838
Browser pages must not seed authoritative records. Setup flows must call server-side APIs.
39-

docs_build/database/dml/account.sql

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,8 +90,10 @@ BEGIN
9090
INTO missing_role_slugs
9191
FROM (
9292
VALUES
93-
('user'),
94-
('admin')
93+
('admin'),
94+
('creator'),
95+
('guest'),
96+
('user')
9597
) AS required_roles(role_slug)
9698
LEFT JOIN roles ON roles."roleSlug" = required_roles.role_slug
9799
WHERE roles.key IS NULL;

docs_build/database/dml/admin.sql

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44
-- Runtime setup/seed operations for this group must run through server-side APIs.
55
-- Temporary scope: DEV/review artifact only until Admin Site Setup/server seed APIs fully own grouped setup.
66
-- Browser pages must not directly seed authoritative DB records.
7-
-- Owned tables: none active
8-
-- Note: Admin Site Setup owns explicit server-side setup/reseed entry points. No persistent admin table exists in this PR.
7+
-- Owned tables: platform_settings
8+
-- Note: Admin Site Setup owns explicit server-side setup/reseed entry points and platform settings bootstrap.
99

1010
-- DML status: Server-seed-owned.
1111
-- Setup is performed through the Admin-owned server-side seed API.
1212
-- Browser pages must not seed authoritative records.
1313
-- The server/API layer generates all non-user keys.
1414
-- This SQL file intentionally has no direct INSERT statements because direct SQL would bypass key/audit ownership.
1515
-- Direct SQL setup for this group remains deferred until a later migration-runner PR explicitly owns it.
16+
-- Starter server seed rows:
17+
-- platform_settings.settingKey = site.setup.status

docs_build/database/dml/support-tickets.sql

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,14 @@
44
-- Runtime setup/seed operations for this group must run through server-side APIs.
55
-- Temporary scope: DEV/review artifact only until Admin Site Setup/server seed APIs fully own grouped setup.
66
-- Browser pages must not directly seed authoritative DB records.
7-
-- Owned tables: none active
8-
-- Note: Support ticket tables are not active in the Local DB adapter yet.
7+
-- Owned tables: support_categories
8+
-- Note: Support category setup is active in the Local DB adapter through Admin Site Setup/server seed ownership.
99

10-
-- DML status: Future/not-yet-owned.
11-
-- No setup is performed for this group yet because there are no active Local DB support ticket tables.
10+
-- DML status: Server-seed-owned.
11+
-- Setup is performed through the Admin-owned server-side seed API.
1212
-- Browser pages must not seed authoritative records.
1313
-- The server/API layer generates all non-user keys.
1414
-- This SQL file intentionally has no direct INSERT statements because direct SQL would bypass key/audit ownership.
15-
-- Direct SQL setup and server-side seed ownership remain deferred until a later support-ticket persistence PR explicitly owns them.
15+
-- Direct SQL setup remains deferred until a later migration-runner PR explicitly owns it.
16+
-- Starter server seed rows:
17+
-- support_categories.categorySlug = general-help

docs_build/database/seed/account.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@
4141
},
4242
"roles": {
4343
"mode": "server-api-generated-keys",
44-
"requiredRoleSlugs": ["user", "admin"]
44+
"requiredRoleSlugs": ["admin", "creator", "guest", "user"]
4545
},
4646
"user_roles": {
4747
"mode": "server-side-upsert",

docs_build/database/seed/admin.json

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@
44
"owner": "docs_build/database/seed",
55
"serverSideSeedRequired": true,
66
"browserAuthoritativeKeyGenerationAllowed": false,
7-
"tables": {},
8-
"note": "Admin Site Setup owns explicit server-side setup/reseed entry points. No persistent admin table exists in this PR."
7+
"tables": {
8+
"platform_settings": {
9+
"mode": "server-api-generated-keys",
10+
"starterRows": [
11+
{
12+
"settingKey": "site.setup.status",
13+
"settingType": "string",
14+
"settingValue": "ready"
15+
}
16+
]
17+
}
18+
},
19+
"note": "Admin Site Setup owns explicit server-side setup/reseed entry points and platform settings bootstrap."
920
}

docs_build/database/seed/support-tickets.json

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,17 @@
44
"owner": "docs_build/database/seed",
55
"serverSideSeedRequired": true,
66
"browserAuthoritativeKeyGenerationAllowed": false,
7-
"tables": {},
8-
"note": "Support ticket tables are not active in the Local DB adapter yet."
7+
"tables": {
8+
"support_categories": {
9+
"mode": "server-api-generated-keys",
10+
"starterRows": [
11+
{
12+
"categorySlug": "general-help",
13+
"name": "General Help",
14+
"sortOrder": 1
15+
}
16+
]
17+
}
18+
},
19+
"note": "Support category setup is active in the Local DB adapter through Admin Site Setup/server seed ownership."
920
}

0 commit comments

Comments
 (0)