CREATE TABLE "notification_preferences" ( "user_id" text PRIMARY KEY NOT NULL, "email_enabled" boolean DEFAULT true NOT NULL, "sms_enabled" boolean DEFAULT false NOT NULL, "sms_consent_at" timestamp with time zone, "sms_consent_source" text, "sms_consent_ip" text, "reminder_lead_days" integer DEFAULT 7 NOT NULL, "quiet_hours_start" text DEFAULT '21:00' NOT NULL, "quiet_hours_end" text DEFAULT '08:00' NOT NULL, "digest_only" boolean DEFAULT false NOT NULL ); --> statement-breakpoint ALTER TABLE "notification_preferences" ADD CONSTRAINT "notification_preferences_user_id_users_id_fk" FOREIGN KEY ("user_id") REFERENCES "public"."users"("id") ON DELETE cascade ON UPDATE no action;