-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #125 from boostcampwm-2024/feature/deploy
ncloud 서버에서의 데이터베이스 마이그레이션을 위한 prisma/migrations 추가
- Loading branch information
Showing
4 changed files
with
15,728 additions
and
11,707 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
111 changes: 111 additions & 0 deletions
111
apps/server/prisma/migrations/20241120062624_/migration.sql
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,111 @@ | ||
-- CreateTable | ||
CREATE TABLE `private_architecture_version` ( | ||
`id` INTEGER NOT NULL AUTO_INCREMENT, | ||
`private_architecture_id` INTEGER NOT NULL, | ||
`title` CHAR(50) NOT NULL, | ||
`created_at` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0), | ||
`architecture` JSON NOT NULL, | ||
|
||
PRIMARY KEY (`id`) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
|
||
-- CreateTable | ||
CREATE TABLE `private_architecture` ( | ||
`id` INTEGER NOT NULL AUTO_INCREMENT, | ||
`title` CHAR(50) NOT NULL, | ||
`author_id` INTEGER NOT NULL, | ||
`architecture` JSON NOT NULL, | ||
`created_at` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0), | ||
`updated_at` TIMESTAMP(0) NULL, | ||
|
||
PRIMARY KEY (`id`) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
|
||
-- CreateTable | ||
CREATE TABLE `public_architecture_import` ( | ||
`id` INTEGER NOT NULL AUTO_INCREMENT, | ||
`public_architecture_id` INTEGER NOT NULL, | ||
`user_id` INTEGER NOT NULL, | ||
`created_at` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0), | ||
|
||
UNIQUE INDEX `public_architecture_import_public_architecture_id_user_id_key`(`public_architecture_id`, `user_id`), | ||
PRIMARY KEY (`id`) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
|
||
-- CreateTable | ||
CREATE TABLE `public_architecture_star` ( | ||
`id` INTEGER NOT NULL AUTO_INCREMENT, | ||
`public_architecture_id` INTEGER NOT NULL, | ||
`user_id` INTEGER NOT NULL, | ||
`created_at` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0), | ||
|
||
UNIQUE INDEX `public_architecture_star_public_architecture_id_user_id_key`(`public_architecture_id`, `user_id`), | ||
PRIMARY KEY (`id`) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
|
||
-- CreateTable | ||
CREATE TABLE `public_architecture_tag` ( | ||
`id` INTEGER NOT NULL AUTO_INCREMENT, | ||
`public_architecture_id` INTEGER NOT NULL, | ||
`tag_id` INTEGER NOT NULL, | ||
|
||
UNIQUE INDEX `public_architecture_tag_public_architecture_id_tag_id_key`(`public_architecture_id`, `tag_id`), | ||
PRIMARY KEY (`id`) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
|
||
-- CreateTable | ||
CREATE TABLE `public_architecture` ( | ||
`id` INTEGER NOT NULL AUTO_INCREMENT, | ||
`title` CHAR(50) NOT NULL, | ||
`author_id` INTEGER NOT NULL, | ||
`architecture` JSON NOT NULL, | ||
`created_at` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0), | ||
`cost` DOUBLE NOT NULL DEFAULT 0, | ||
|
||
PRIMARY KEY (`id`) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
|
||
-- CreateTable | ||
CREATE TABLE `tag` ( | ||
`id` INTEGER NOT NULL AUTO_INCREMENT, | ||
`name` VARCHAR(15) NOT NULL, | ||
`created_at` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0), | ||
|
||
PRIMARY KEY (`id`) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
|
||
-- CreateTable | ||
CREATE TABLE `user` ( | ||
`id` INTEGER NOT NULL AUTO_INCREMENT, | ||
`name` VARCHAR(30) NOT NULL, | ||
`created_at` TIMESTAMP(0) NOT NULL DEFAULT CURRENT_TIMESTAMP(0), | ||
|
||
PRIMARY KEY (`id`) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE `private_architecture_version` ADD CONSTRAINT `private_architecture_version_private_architecture_id_fkey` FOREIGN KEY (`private_architecture_id`) REFERENCES `private_architecture`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE `private_architecture` ADD CONSTRAINT `private_architecture_author_id_fkey` FOREIGN KEY (`author_id`) REFERENCES `user`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE `public_architecture_import` ADD CONSTRAINT `public_architecture_import_public_architecture_id_fkey` FOREIGN KEY (`public_architecture_id`) REFERENCES `public_architecture`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE `public_architecture_import` ADD CONSTRAINT `public_architecture_import_user_id_fkey` FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE `public_architecture_star` ADD CONSTRAINT `public_architecture_star_public_architecture_id_fkey` FOREIGN KEY (`public_architecture_id`) REFERENCES `public_architecture`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE `public_architecture_star` ADD CONSTRAINT `public_architecture_star_user_id_fkey` FOREIGN KEY (`user_id`) REFERENCES `user`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE `public_architecture_tag` ADD CONSTRAINT `public_architecture_tag_public_architecture_id_fkey` FOREIGN KEY (`public_architecture_id`) REFERENCES `public_architecture`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE `public_architecture_tag` ADD CONSTRAINT `public_architecture_tag_tag_id_fkey` FOREIGN KEY (`tag_id`) REFERENCES `tag`(`id`) ON DELETE RESTRICT ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE `public_architecture` ADD CONSTRAINT `public_architecture_author_id_fkey` FOREIGN KEY (`author_id`) REFERENCES `user`(`id`) ON DELETE RESTRICT 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" |
Oops, something went wrong.