mirror of
https://github.com/ngthanhvu/kr-phim.git
synced 2026-08-10 16:47:46 +00:00
Add database migration snapshots for comment_votes, comments, movies, and users tables
- Created 0009_snapshot.json with initial structure for comment_votes, comments, movies, and users tables. - Created 0010_snapshot.json with updated structure for comments, including new fields: pinned and spoiler. - Created 0011_snapshot.json with further updates to comments, adding anonymous field and refining existing structures.
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
CREATE TABLE `comments` (
|
||||
`id` int AUTO_INCREMENT NOT NULL,
|
||||
`user_id` int NOT NULL,
|
||||
`source` varchar(50) NOT NULL DEFAULT '',
|
||||
`slug` varchar(500) NOT NULL,
|
||||
`movie_name` varchar(500),
|
||||
`content` text NOT NULL,
|
||||
`created_at` timestamp NOT NULL DEFAULT (now()),
|
||||
`updated_at` timestamp NOT NULL DEFAULT (now()) ON UPDATE CURRENT_TIMESTAMP,
|
||||
CONSTRAINT `comments_id` PRIMARY KEY(`id`)
|
||||
);
|
||||
--> statement-breakpoint
|
||||
CREATE INDEX `idx_source_slug` ON `comments` (`source`,`slug`);--> statement-breakpoint
|
||||
CREATE INDEX `idx_user_id` ON `comments` (`user_id`);
|
||||
Reference in New Issue
Block a user