CREATE TABLE `records` (
	`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
	`record_id` text NOT NULL,
	`type_id` integer NOT NULL,
	FOREIGN KEY (`type_id`) REFERENCES `record_types`(`id`) ON UPDATE no action ON DELETE no action
);
--> statement-breakpoint
CREATE UNIQUE INDEX `records_record_id_unique` ON `records` (`record_id`);--> statement-breakpoint
CREATE INDEX `chores_index` ON `records` (`record_id`) WHERE type_id = ?;--> statement-breakpoint
CREATE INDEX `project_index` ON `records` (`record_id`) WHERE type_id = ?;--> statement-breakpoint
CREATE INDEX `ticket_index` ON `records` (`record_id`) WHERE type_id = ?;--> statement-breakpoint
CREATE TABLE `record_types` (
	`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
	`type` text
);
