-
Notifications
You must be signed in to change notification settings - Fork 2
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 #341 from boostcampwm2023/BE-develop
merge
- Loading branch information
Showing
74 changed files
with
1,899 additions
and
1,083 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
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
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 |
---|---|---|
|
@@ -32,7 +32,3 @@ lerna-debug.log* | |
|
||
# Environment Variable File | ||
.env | ||
|
||
# csv, prisma | ||
/operations | ||
/prisma/generated |
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
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 @@ | ||
#!/bin/sh | ||
npx prisma migrate deploy | ||
npm start |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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
12 changes: 12 additions & 0 deletions
12
nestjs-BE/server/prisma/migrations/20240430062129_set_max_length/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,12 @@ | ||
/* | ||
Warnings: | ||
- You are about to alter the column `nickname` on the `PROFILE_TB` table. The data in that column could be lost. The data in that column will be cast from `VarChar(191)` to `VarChar(20)`. | ||
- You are about to alter the column `name` on the `SPACE_TB` table. The data in that column could be lost. The data in that column will be cast from `VarChar(191)` to `VarChar(20)`. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE `PROFILE_TB` MODIFY `nickname` VARCHAR(20) NOT NULL; | ||
|
||
-- AlterTable | ||
ALTER TABLE `SPACE_TB` MODIFY `name` VARCHAR(20) NOT NULL; |
5 changes: 5 additions & 0 deletions
5
nestjs-BE/server/prisma/migrations/20240430064956_rename_user_model/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,5 @@ | ||
-- RenameIndex | ||
ALTER TABLE `USER_TB` RENAME INDEX `USER_TB_email_provider_key` TO `User_email_provider_key`; | ||
|
||
-- RenameTable | ||
ALTER TABLE `USER_TB` RENAME `User`; |
11 changes: 11 additions & 0 deletions
11
nestjs-BE/server/prisma/migrations/20240430082846_rename_profile_model/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,11 @@ | ||
-- DropForeignKey | ||
ALTER TABLE `PROFILE_TB` DROP FOREIGN KEY `PROFILE_TB_user_id_fkey`; | ||
|
||
-- RenameIndex | ||
ALTER TABLE `PROFILE_TB` RENAME INDEX `PROFILE_TB_user_id_key` TO `Profile_user_id_key`; | ||
|
||
-- RenameTable | ||
ALTER TABLE `PROFILE_TB` RENAME `Profile`; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE `Profile` ADD CONSTRAINT `Profile_user_id_fkey` FOREIGN KEY (`user_id`) REFERENCES `User`(`uuid`) ON DELETE CASCADE ON UPDATE CASCADE; |
26 changes: 26 additions & 0 deletions
26
nestjs-BE/server/prisma/migrations/20240509025953_rename_models/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,26 @@ | ||
-- DropForeignKey | ||
ALTER TABLE `INVITE_CODE_TB` DROP FOREIGN KEY `INVITE_CODE_TB_space_uuid_fkey`; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE `PROFILE_SPACE_TB` DROP FOREIGN KEY `PROFILE_SPACE_TB_profile_uuid_fkey`; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE `PROFILE_SPACE_TB` DROP FOREIGN KEY `PROFILE_SPACE_TB_space_uuid_fkey`; | ||
|
||
-- RenameIndex | ||
ALTER TABLE `PROFILE_SPACE_TB` RENAME INDEX `PROFILE_SPACE_TB_space_uuid_profile_uuid_key` TO `Profile_space_space_uuid_profile_uuid_key`; | ||
|
||
-- RenameTable | ||
ALTER TABLE `PROFILE_SPACE_TB` RENAME `Profile_space`; | ||
|
||
-- RenameTable | ||
ALTER TABLE `SPACE_TB` RENAME `Space`; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE `Profile_space` ADD CONSTRAINT `Profile_space_space_uuid_fkey` FOREIGN KEY (`space_uuid`) REFERENCES `Space`(`uuid`) ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE `Profile_space` ADD CONSTRAINT `Profile_space_profile_uuid_fkey` FOREIGN KEY (`profile_uuid`) REFERENCES `Profile`(`uuid`) ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE `INVITE_CODE_TB` ADD CONSTRAINT `INVITE_CODE_TB_space_uuid_fkey` FOREIGN KEY (`space_uuid`) REFERENCES `Space`(`uuid`) ON DELETE CASCADE ON UPDATE CASCADE; |
20 changes: 20 additions & 0 deletions
20
...BE/server/prisma/migrations/20240511061416_rename_refresh_token_invite_code/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,20 @@ | ||
-- DropForeignKey | ||
ALTER TABLE `INVITE_CODE_TB` DROP FOREIGN KEY `INVITE_CODE_TB_space_uuid_fkey`; | ||
|
||
-- DropForeignKey | ||
ALTER TABLE `REFRESH_TOKEN_TB` DROP FOREIGN KEY `REFRESH_TOKEN_TB_user_id_fkey`; | ||
|
||
-- RenameIndex | ||
ALTER TABLE `INVITE_CODE_TB` RENAME INDEX `INVITE_CODE_TB_invite_code_key` TO `InviteCode_invite_code_key`; | ||
|
||
-- RenameTable | ||
ALTER TABLE `INVITE_CODE_TB` RENAME `InviteCode`; | ||
|
||
-- RenameTable | ||
ALTER TABLE `REFRESH_TOKEN_TB` RENAME `RefreshToken`; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE `RefreshToken` ADD CONSTRAINT `RefreshToken_user_id_fkey` FOREIGN KEY (`user_id`) REFERENCES `User`(`uuid`) ON DELETE CASCADE ON UPDATE CASCADE; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE `InviteCode` ADD CONSTRAINT `InviteCode_space_uuid_fkey` FOREIGN KEY (`space_uuid`) REFERENCES `Space`(`uuid`) ON DELETE CASCADE ON UPDATE CASCADE; |
17 changes: 17 additions & 0 deletions
17
nestjs-BE/server/prisma/migrations/20240513072450_fix_refresh_token/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,17 @@ | ||
/* | ||
Warnings: | ||
- The primary key for the `RefreshToken` table will be changed. If it partially fails, the table could be left without primary key constraint. | ||
- Added the required column `id` to the `RefreshToken` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE `RefreshToken` DROP PRIMARY KEY, | ||
ADD COLUMN `id` INTEGER NOT NULL AUTO_INCREMENT, | ||
RENAME COLUMN `uuid` TO `token`, | ||
ADD PRIMARY KEY (`id`); | ||
|
||
ALTER TABLE `RefreshToken` MODIFY `token` VARCHAR(210) NOT NULL; | ||
|
||
-- CreateIndex | ||
CREATE INDEX `RefreshToken_token_idx` ON `RefreshToken`(`token`); |
11 changes: 11 additions & 0 deletions
11
nestjs-BE/server/prisma/migrations/20240513082711_alter_index/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,11 @@ | ||
/* | ||
Warnings: | ||
- A unique constraint covering the columns `[token]` on the table `RefreshToken` will be added. If there are existing duplicate values, this will fail. | ||
*/ | ||
-- DropIndex | ||
DROP INDEX `RefreshToken_token_idx` ON `RefreshToken`; | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX `RefreshToken_token_key` ON `RefreshToken`(`token`); |
This file was deleted.
Oops, something went wrong.
43 changes: 21 additions & 22 deletions
43
nestjs-BE/server/prisma/mysql.schema.prisma → nestjs-BE/server/prisma/schema.prisma
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 |
---|---|---|
@@ -1,60 +1,59 @@ | ||
generator client { | ||
provider = "prisma-client-js" | ||
output = "./generated/mysql" | ||
} | ||
|
||
datasource db { | ||
provider = "mysql" | ||
url = env("MYSQL_DATABASE_URL") | ||
} | ||
|
||
model USER_TB { | ||
model User { | ||
uuid String @id @db.VarChar(32) | ||
email String | ||
provider String | ||
profiles PROFILE_TB[] | ||
refresh_tokens REFRESH_TOKEN_TB[] | ||
profiles Profile[] | ||
refresh_tokens RefreshToken[] | ||
@@unique([email, provider]) | ||
} | ||
|
||
model REFRESH_TOKEN_TB { | ||
uuid String @id @db.VarChar(32) | ||
token String @unique | ||
model RefreshToken { | ||
id Int @id @default(autoincrement()) | ||
token String @db.VarChar(210) | ||
expiry_date DateTime | ||
user_id String | ||
user USER_TB @relation(fields: [user_id], references: [uuid], onDelete: Cascade) | ||
user User @relation(fields: [user_id], references: [uuid], onDelete: Cascade) | ||
@@unique([token]) | ||
} | ||
|
||
model PROFILE_TB { | ||
model Profile { | ||
uuid String @id @db.VarChar(32) | ||
user_id String @unique @db.VarChar(32) | ||
image String | ||
nickname String | ||
user USER_TB @relation(fields: [user_id], references: [uuid], onDelete: Cascade) | ||
spaces PROFILE_SPACE_TB[] | ||
nickname String @db.VarChar(20) | ||
user User @relation(fields: [user_id], references: [uuid], onDelete: Cascade) | ||
spaces Profile_space[] | ||
} | ||
|
||
model SPACE_TB { | ||
model Space { | ||
uuid String @id @db.VarChar(32) | ||
name String | ||
name String @db.VarChar(20) | ||
icon String | ||
profiles PROFILE_SPACE_TB[] | ||
invite_codes INVITE_CODE_TB[] | ||
profiles Profile_space[] | ||
invite_codes InviteCode[] | ||
} | ||
|
||
model PROFILE_SPACE_TB { | ||
model Profile_space { | ||
space_uuid String @db.VarChar(32) | ||
profile_uuid String @db.VarChar(32) | ||
space SPACE_TB @relation(fields: [space_uuid], references: [uuid], onDelete: Cascade) | ||
profile PROFILE_TB @relation(fields: [profile_uuid], references: [uuid], onDelete: Cascade) | ||
space Space @relation(fields: [space_uuid], references: [uuid], onDelete: Cascade) | ||
profile Profile @relation(fields: [profile_uuid], references: [uuid], onDelete: Cascade) | ||
@@unique([space_uuid, profile_uuid]) | ||
} | ||
|
||
model INVITE_CODE_TB { | ||
model InviteCode { | ||
uuid String @id @db.VarChar(32) | ||
invite_code String @unique @db.VarChar(10) | ||
space_uuid String @db.VarChar(32) | ||
expiry_date DateTime | ||
space SPACE_TB @relation(fields: [space_uuid], references: [uuid], onDelete: Cascade) | ||
space Space @relation(fields: [space_uuid], references: [uuid], onDelete: 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
Oops, something went wrong.