-
Notifications
You must be signed in to change notification settings - Fork 0
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 #19 from J-hoplin1/feat/problem-issue
Feat/problem issue
- Loading branch information
Showing
45 changed files
with
1,719 additions
and
142 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,9 @@ | ||
#!/usr/bin/env bash | ||
node node_modules/prisma/build/index.js db push | ||
|
||
# Add database migration script | ||
node node_modules/prisma/build/index.js migrate resolve --applied 20240109151719_submission_ispulic | ||
node node_modules/prisma/build/index.js migrate resolve --applied 20240113073649_problem_issue_comment | ||
node node_modules/prisma/build/index.js migrate resolve --applied 20240113161205_problem_issue_comment_user | ||
node node_modules/prisma/build/index.js migrate resolve --applied 20240114010304_chagne_issue_comment_name | ||
node node_modules/prisma/build/index.js migrate resolve --applied 20240114021108_issue_comment_problem_relation | ||
node node_modules/prisma/build/index.js migrate resolve --applied 20240114021239_modify_problem_issue_problem |
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,19 @@ | ||
import { ApiProperty } from '@nestjs/swagger'; | ||
import { ProblemIssueComment } from '@prisma/client'; | ||
|
||
export class ProblemIssueCommentDomain implements ProblemIssueComment { | ||
@ApiProperty() | ||
id: number; | ||
|
||
@ApiProperty() | ||
content: string; | ||
|
||
@ApiProperty() | ||
issueId: number; | ||
|
||
@ApiProperty() | ||
problemId: number; | ||
|
||
@ApiProperty() | ||
userId: string; | ||
} |
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
17 changes: 0 additions & 17 deletions
17
prisma/migrations/20231203061100_user_type_migration/migration.sql
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
9 changes: 0 additions & 9 deletions
9
prisma/migrations/20240102053827_submission_datetime/migration.sql
This file was deleted.
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
11 changes: 11 additions & 0 deletions
11
prisma/migrations/20240113073649_problem_issue_comment/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 @@ | ||
-- CreateTable | ||
CREATE TABLE `problem_issue_comment` ( | ||
`id` INTEGER NOT NULL AUTO_INCREMENT, | ||
`content` TEXT NOT NULL, | ||
`problemId` INTEGER NOT NULL, | ||
|
||
PRIMARY KEY (`id`) | ||
) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE `problem_issue_comment` ADD CONSTRAINT `problem_issue_comment_problemId_fkey` FOREIGN KEY (`problemId`) REFERENCES `problem_issue`(`id`) ON DELETE CASCADE ON UPDATE CASCADE; |
11 changes: 11 additions & 0 deletions
11
prisma/migrations/20240113161205_problem_issue_comment_user/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: | ||
- Added the required column `userId` to the `problem_issue_comment` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE `problem_issue_comment` ADD COLUMN `userId` VARCHAR(191) NOT NULL; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE `problem_issue_comment` ADD CONSTRAINT `problem_issue_comment_userId_fkey` FOREIGN KEY (`userId`) REFERENCES `user`(`id`) ON DELETE CASCADE ON UPDATE CASCADE; |
19 changes: 19 additions & 0 deletions
19
prisma/migrations/20240114010304_chagne_issue_comment_name/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,19 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `problemId` on the `problem_issue_comment` table. All the data in the column will be lost. | ||
- Added the required column `issueId` to the `problem_issue_comment` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
-- DropForeignKey | ||
ALTER TABLE `problem_issue_comment` DROP FOREIGN KEY `problem_issue_comment_problemId_fkey`; | ||
|
||
-- AlterTable | ||
ALTER TABLE `problem_issue` MODIFY `title` VARCHAR(100) NOT NULL DEFAULT 'Title Here'; | ||
|
||
-- AlterTable | ||
ALTER TABLE `problem_issue_comment` DROP COLUMN `problemId`, | ||
ADD COLUMN `issueId` INTEGER NOT NULL; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE `problem_issue_comment` ADD CONSTRAINT `problem_issue_comment_issueId_fkey` FOREIGN KEY (`issueId`) REFERENCES `problem_issue`(`id`) ON DELETE CASCADE ON UPDATE CASCADE; |
11 changes: 11 additions & 0 deletions
11
prisma/migrations/20240114021108_issue_comment_problem_relation/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: | ||
- Added the required column `problemId` to the `problem_issue_comment` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
-- AlterTable | ||
ALTER TABLE `problem_issue_comment` ADD COLUMN `problemId` INTEGER NOT NULL; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE `problem_issue_comment` ADD CONSTRAINT `problem_issue_comment_problemId_fkey` FOREIGN KEY (`problemId`) REFERENCES `problem`(`id`) ON DELETE CASCADE ON UPDATE CASCADE; |
16 changes: 16 additions & 0 deletions
16
prisma/migrations/20240114021239_modify_problem_issue_problem/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,16 @@ | ||
/* | ||
Warnings: | ||
- You are about to drop the column `targetId` on the `problem_issue` table. All the data in the column will be lost. | ||
- Added the required column `problemId` to the `problem_issue` table without a default value. This is not possible if the table is not empty. | ||
*/ | ||
-- DropForeignKey | ||
ALTER TABLE `problem_issue` DROP FOREIGN KEY `problem_issue_targetId_fkey`; | ||
|
||
-- AlterTable | ||
ALTER TABLE `problem_issue` DROP COLUMN `targetId`, | ||
ADD COLUMN `problemId` INTEGER NOT NULL; | ||
|
||
-- AddForeignKey | ||
ALTER TABLE `problem_issue` ADD CONSTRAINT `problem_issue_problemId_fkey` FOREIGN KEY (`problemId`) REFERENCES `problem`(`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
Oops, something went wrong.