-- Create identity_notifications table for user notification preferences CREATE TABLE identity_notifications ( did TEXT PRIMARY KEY, email TEXT DEFAULT NULL, confirmed_at TIMESTAMPTZ DEFAULT NULL, email_on_rsvp BOOLEAN NOT NULL DEFAULT false, email_on_event_change BOOLEAN NOT NULL DEFAULT false, email_on_24h BOOLEAN NOT NULL DEFAULT false, created_at TIMESTAMPTZ NOT NULL, updated_at TIMESTAMPTZ NOT NULL ); -- Create index on email for webhook lookups CREATE INDEX idx_identity_notifications_email ON identity_notifications(email) WHERE email IS NOT NULL;