Initial Commit

This commit is contained in:
2026-10-03 20:07:49 +02:00
commit a1346c98b1
427 changed files with 59320 additions and 0 deletions
@@ -0,0 +1,16 @@
CREATE TABLE `tags` (
`id` bigint unsigned AUTO_INCREMENT NOT NULL,
`name` varchar(64) NOT NULL,
`created_at` timestamp NOT NULL DEFAULT (now()),
CONSTRAINT `tags_id` PRIMARY KEY(`id`),
CONSTRAINT `tags_name_unique` UNIQUE(`name`)
);
--> statement-breakpoint
CREATE TABLE `upload_tags` (
`upload_id` varchar(8) NOT NULL,
`tag_id` bigint unsigned NOT NULL,
CONSTRAINT `upload_tags_upload_id_tag_id_pk` PRIMARY KEY(`upload_id`,`tag_id`)
);
--> statement-breakpoint
ALTER TABLE `upload_tags` ADD CONSTRAINT `upload_tags_upload_id_uploads_id_fk` FOREIGN KEY (`upload_id`) REFERENCES `uploads`(`id`) ON DELETE cascade ON UPDATE no action;--> statement-breakpoint
ALTER TABLE `upload_tags` ADD CONSTRAINT `upload_tags_tag_id_tags_id_fk` FOREIGN KEY (`tag_id`) REFERENCES `tags`(`id`) ON DELETE cascade ON UPDATE no action;