CREATE TABLE `departures` (
	`id` text PRIMARY KEY NOT NULL,
	`code` text NOT NULL,
	`route_id` text NOT NULL,
	`title` text NOT NULL,
	`capacity` integer NOT NULL,
	`used` integer DEFAULT 0 NOT NULL,
	`opens_at` integer NOT NULL,
	`closes_at` integer NOT NULL,
	`mode` text NOT NULL,
	`created_at` integer NOT NULL
);
--> statement-breakpoint
CREATE UNIQUE INDEX `departures_code_unique` ON `departures` (`code`);--> statement-breakpoint
CREATE TABLE `runs` (
	`id` text PRIMARY KEY NOT NULL,
	`departure_id` text NOT NULL,
	`name` text NOT NULL,
	`people` integer NOT NULL,
	`audience` text NOT NULL,
	`language` text NOT NULL,
	`started_at` integer NOT NULL,
	`finished_at` integer,
	`step` integer DEFAULT 0 NOT NULL,
	`penalties` integer DEFAULT 0 NOT NULL,
	`unlocked_step` integer DEFAULT -1 NOT NULL,
	`snapshot` text NOT NULL,
	`answers` text DEFAULT '[]' NOT NULL
);
--> statement-breakpoint
CREATE TABLE `settings` (
	`id` text PRIMARY KEY NOT NULL,
	`value` text NOT NULL
);
