feat: add media management (#1337)
* feat: add media management * feat: add missing page search item * fix: medias should be hidden for anonymous users * chore: rename show-all to include-from-all-users * fix: inconsistent table column for creator-id of media * fix: schema check not working because of custom type for blob in mysql * chore: temporarily remove migrations * chore: readd removed migrations
This commit is contained in:
12
packages/db/migrations/mysql/0014_bizarre_red_shift.sql
Normal file
12
packages/db/migrations/mysql/0014_bizarre_red_shift.sql
Normal file
@@ -0,0 +1,12 @@
|
||||
CREATE TABLE `media` (
|
||||
`id` varchar(64) NOT NULL,
|
||||
`name` varchar(512) NOT NULL,
|
||||
`content` BLOB NOT NULL,
|
||||
`content_type` text NOT NULL,
|
||||
`size` int NOT NULL,
|
||||
`created_at` timestamp NOT NULL DEFAULT (now()),
|
||||
`creator_id` varchar(64),
|
||||
CONSTRAINT `media_id` PRIMARY KEY(`id`)
|
||||
);
|
||||
--> statement-breakpoint
|
||||
ALTER TABLE `media` ADD CONSTRAINT `media_creator_id_user_id_fk` FOREIGN KEY (`creator_id`) REFERENCES `user`(`id`) ON DELETE set null ON UPDATE no action;
|
||||
Reference in New Issue
Block a user