Add Notes table in flyway migration
This commit is contained in:
parent
e48e22de5d
commit
4ff9e5ae2e
11
api/resources/db/migration/V2__Create_note_table.sql
Normal file
11
api/resources/db/migration/V2__Create_note_table.sql
Normal file
@ -0,0 +1,11 @@
|
||||
CREATE TABLE `Notes`
|
||||
(
|
||||
`id` int PRIMARY KEY AUTO_INCREMENT,
|
||||
`title` varchar(50) NOT NULL,
|
||||
`content` text NOT NULL,
|
||||
`user_id` int NOT NULL,
|
||||
`last_viewed` datetime
|
||||
);
|
||||
|
||||
ALTER TABLE `Notes`
|
||||
ADD FOREIGN KEY (`user_id`) REFERENCES `Users` (`id`) ON DELETE RESTRICT ON UPDATE RESTRICT;
|
||||
Loading…
x
Reference in New Issue
Block a user