tiqued/drizzle/0000_wandering_riptide.sql
themodrnhakr daa85abc8c Fix invalid SQL syntax for index creation.
One of the sql generations mistakenly looked for a field value of '?'.
Whatever code was causing this to occur is no longer an issue. This does
highlight the difficulty of needing to delete or modify faulty migration
files.
2025-09-25 15:57:52 -05:00

16 lines
747 B
SQL

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 = 1;--> statement-breakpoint
CREATE INDEX `project_index` ON `records` (`record_id`) WHERE type_id = 2;--> statement-breakpoint
CREATE INDEX `ticket_index` ON `records` (`record_id`) WHERE type_id = 3;--> statement-breakpoint
CREATE TABLE `record_types` (
`id` integer PRIMARY KEY AUTOINCREMENT NOT NULL,
`type` text
);