-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3894f7d
commit 4a81900
Showing
2 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
-- CreateTable | ||
CREATE TABLE `user` ( | ||
`id` VARCHAR(191) NOT NULL, | ||
`username` VARCHAR(191) NOT NULL, | ||
`email` VARCHAR(191) NOT NULL, | ||
`password` VARCHAR(191) NOT NULL, | ||
`bio` VARCHAR(191) NULL DEFAULT 'I Like Mangazuna', | ||
`emailVerified` DATETIME(3) NULL, | ||
`image` VARCHAR(191) NULL DEFAULT 'https://res.cloudinary.com/dyr5sva6n/image/upload/v1702635115/profile/profile_temmit.jpg', | ||
`role` ENUM('ADMIN', 'USER') NOT NULL DEFAULT 'USER', | ||
`createdAt` DATETIME(3) NOT NULL DEFAULT CURRENT_TIMESTAMP(3), | ||
|
||
UNIQUE INDEX `user_email_key`(`email`), | ||
PRIMARY KEY (`id`) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
|
||
-- CreateTable | ||
CREATE TABLE `bookmark` ( | ||
`id` VARCHAR(191) NOT NULL, | ||
`title` VARCHAR(191) NOT NULL, | ||
`image` VARCHAR(191) NOT NULL, | ||
`url` VARCHAR(191) NOT NULL, | ||
`rating` VARCHAR(191) NOT NULL, | ||
`total_chapters` INTEGER NOT NULL, | ||
`userId` VARCHAR(191) NULL, | ||
|
||
INDEX `bookmark_userId_idx`(`userId`), | ||
PRIMARY KEY (`id`) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE `bookmark` ADD CONSTRAINT `bookmark_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `user`(`id`) ON DELETE CASCADE ON UPDATE CASCADE; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Please do not edit this file manually | ||
# It should be added in your version-control system (i.e. Git) | ||
provider = "mysql" |