CREATE TABLE "platform_settings" ( "id" text PRIMARY KEY DEFAULT 'default' NOT NULL, "piggy_model" text DEFAULT 'nvidia/nemotron-3-nano-30b-a3b' NOT NULL, "piggy_inference_base" text DEFAULT 'https://api.pinference.ai/api/v1' NOT NULL, "piggy_enabled" boolean DEFAULT false NOT NULL, "prime_api_key_encrypted" text, "prime_api_key_updated_at" timestamp with time zone, "prime_sync_enabled" boolean DEFAULT false NOT NULL, "prime_sync_interval_minutes" integer DEFAULT 30 NOT NULL, "updated_by_user_id" uuid, "updated_at" timestamp with time zone DEFAULT now() NOT NULL, CONSTRAINT "platform_settings_singleton_check" CHECK ("platform_settings"."id" = 'default'), CONSTRAINT "platform_settings_sync_interval_check" CHECK ("platform_settings"."prime_sync_interval_minutes" BETWEEN 1 AND 1440) ); --> statement-breakpoint ALTER TABLE "platform_settings" ADD CONSTRAINT "platform_settings_updated_by_user_id_users_id_fk" FOREIGN KEY ("updated_by_user_id") REFERENCES "public"."users"("id") ON DELETE set null ON UPDATE no action;