Skip to content

Commit

Permalink
add migration
Browse files Browse the repository at this point in the history
  • Loading branch information
LuckyIndraEfendi committed Jun 3, 2024
1 parent 3894f7d commit 4a81900
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 0 deletions.
32 changes: 32 additions & 0 deletions prisma/migrations/20240603055241_mangazuna/migration.sql
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;
3 changes: 3 additions & 0 deletions prisma/migrations/migration_lock.toml
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"

0 comments on commit 4a81900

Please sign in to comment.