diff --git a/deploy/init.sql b/deploy/init.sql index 2c63fff..4221a20 100644 --- a/deploy/init.sql +++ b/deploy/init.sql @@ -142,8 +142,9 @@ INSERT INTO public.membership_types (name, display_name, annual_dues, descriptio ('honorary', 'Honorary Member', 0.00, 'Granted by the board', false, 5); -- MEMBERS TABLE +-- Note: FK to auth.users is added after GoTrue creates the auth schema CREATE TABLE public.members ( - id UUID PRIMARY KEY REFERENCES auth.users(id) ON DELETE CASCADE, + id UUID PRIMARY KEY, member_id TEXT UNIQUE NOT NULL, first_name TEXT NOT NULL, last_name TEXT NOT NULL, @@ -945,7 +946,7 @@ USING ( -- AUDIT LOGS TABLE CREATE TABLE IF NOT EXISTS audit_logs ( id UUID PRIMARY KEY DEFAULT gen_random_uuid(), - user_id UUID REFERENCES auth.users(id) ON DELETE SET NULL, + user_id UUID, user_email TEXT, action TEXT NOT NULL, resource_type TEXT,