CREATE TABLE `application_declarations` (
	`application_id` text PRIMARY KEY NOT NULL,
	`social_support_type` text,
	`guardian_mode` text NOT NULL,
	`works_in_influence_area` integer DEFAULT false NOT NULL,
	`information_confirmed_at` text NOT NULL,
	`truth_confirmed_at` text NOT NULL,
	`privacy_confirmed_at` text NOT NULL,
	FOREIGN KEY (`application_id`) REFERENCES `applications`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
CREATE TABLE `public_messages` (
	`id` text PRIMARY KEY NOT NULL,
	`kind` text NOT NULL,
	`name` text,
	`email` text,
	`phone` text,
	`subject` text,
	`relationship` text,
	`event_date` text,
	`identity_mode` text,
	`message` text NOT NULL,
	`status` text DEFAULT 'NEW' NOT NULL,
	`created_at` text NOT NULL
);
--> statement-breakpoint
CREATE INDEX `idx_public_messages_kind_status_created` ON `public_messages` (`kind`,`status`,`created_at`);--> statement-breakpoint
CREATE TABLE `siblings` (
	`id` text PRIMARY KEY NOT NULL,
	`application_id` text NOT NULL,
	`student_number` text NOT NULL,
	`created_at` text NOT NULL,
	FOREIGN KEY (`application_id`) REFERENCES `applications`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
CREATE INDEX `idx_siblings_application` ON `siblings` (`application_id`);