Skip to content

Commit

Permalink
[backend] Remove tags
Browse files Browse the repository at this point in the history
  • Loading branch information
MananGandhi1810 committed Dec 11, 2024
1 parent 997fefc commit 29956aa
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 18 deletions.
21 changes: 21 additions & 0 deletions backend/prisma/migrations/20241211122626_remove_tags/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
/*
Warnings:
- You are about to drop the `ProblemTag` table. If the table is not empty, all the data it contains will be lost.
- You are about to drop the `Tag` table. If the table is not empty, all the data it contains will be lost.
*/
-- DropForeignKey
ALTER TABLE "ProblemStatement" DROP CONSTRAINT "ProblemStatement_tagId_fkey";

-- DropForeignKey
ALTER TABLE "ProblemTag" DROP CONSTRAINT "ProblemTag_problemId_fkey";

-- DropForeignKey
ALTER TABLE "ProblemTag" DROP CONSTRAINT "ProblemTag_tagId_fkey";

-- DropTable
DROP TABLE "ProblemTag";

-- DropTable
DROP TABLE "Tag";
18 changes: 0 additions & 18 deletions backend/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,7 @@ model ProblemStatement {
submissions Submission[]
testCase Testcase[]
editorials Editorial[]
Tag Tag? @relation(fields: [tagId], references: [id])
tagId String?
ProblemTag ProblemTag[]
}

model Testcase {
Expand All @@ -92,19 +90,3 @@ model Editorial {
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}

model Tag {
id String @id @default(cuid())
name String
problems ProblemStatement[]
ProblemTag ProblemTag[]
}

model ProblemTag {
id String @id @default(cuid())
problem ProblemStatement @relation(fields: [problemId], references: [id], onDelete: Cascade)
problemId String
tag Tag @relation(fields: [tagId], references: [id], onDelete: Cascade)
tagId String
createdAt DateTime @default(now())
}

0 comments on commit 29956aa

Please sign in to comment.