chore: supabase CLI setup, migrations, type regeneration - Install supabase CLI as dev dependency - Fix migration 023: use gen_random_uuid() instead of uuid_generate_v4() - Push migrations 023 + 024 to remote Supabase - Regenerate TypeScript types from live DB schema - Remove all (supabase as any) workaround casts across 6 files - Add convenience type aliases to generated types file - Align EventMember/EventRole/EventDepartment interfaces with DB nullability - Add npm scripts: db:push, db:types, db:migrate - svelte-check: 0 errors, vitest: 112/112 passed
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
-- 1. Event Roles: customizable per-event position types
|
||||
-- ============================================================
|
||||
CREATE TABLE event_roles (
|
||||
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
event_id UUID NOT NULL REFERENCES events(id) ON DELETE CASCADE,
|
||||
name TEXT NOT NULL,
|
||||
color TEXT NOT NULL DEFAULT '#6366f1',
|
||||
@@ -21,7 +21,7 @@ CREATE INDEX idx_event_roles_event ON event_roles(event_id);
|
||||
-- 2. Event Departments: teams/areas within an event
|
||||
-- ============================================================
|
||||
CREATE TABLE event_departments (
|
||||
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
event_id UUID NOT NULL REFERENCES events(id) ON DELETE CASCADE,
|
||||
name TEXT NOT NULL,
|
||||
color TEXT NOT NULL DEFAULT '#00A3E0',
|
||||
@@ -44,7 +44,7 @@ ALTER TABLE event_members
|
||||
-- 4. Member-Department assignments (many-to-many)
|
||||
-- ============================================================
|
||||
CREATE TABLE event_member_departments (
|
||||
id UUID PRIMARY KEY DEFAULT uuid_generate_v4(),
|
||||
id UUID PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
event_member_id UUID NOT NULL REFERENCES event_members(id) ON DELETE CASCADE,
|
||||
department_id UUID NOT NULL REFERENCES event_departments(id) ON DELETE CASCADE,
|
||||
assigned_at TIMESTAMPTZ DEFAULT now(),
|
||||
|
||||
Reference in New Issue
Block a user