Files
taptapp/drizzle/0001_easy_khan.sql
2025-07-22 17:03:36 +02:00

17 lines
850 B
SQL

PRAGMA foreign_keys=OFF;--> statement-breakpoint
CREATE TABLE `__new_audio_file` (
`id` text PRIMARY KEY NOT NULL,
`filename` text NOT NULL,
`content_type` text NOT NULL,
`data` blob DEFAULT 'null',
`s3_key` text,
`duration` real,
`file_size` integer,
`created_at` integer NOT NULL
);
--> statement-breakpoint
INSERT INTO `__new_audio_file`("id", "filename", "content_type", "data", "s3_key", "duration", "file_size", "created_at") SELECT "id", "filename", "content_type", "data", "s3_key", "duration", "file_size", "created_at" FROM `audio_file`;--> statement-breakpoint
DROP TABLE `audio_file`;--> statement-breakpoint
ALTER TABLE `__new_audio_file` RENAME TO `audio_file`;--> statement-breakpoint
PRAGMA foreign_keys=ON;--> statement-breakpoint
CREATE UNIQUE INDEX `participant_audio_unique` ON `rating` (`participant_id`,`audio_file_id`);