From 24bdf980a9da423bf33a316e46bab6115f29f54a Mon Sep 17 00:00:00 2001 From: Tony Vi Date: Fri, 14 Apr 2023 01:40:27 +0300 Subject: [PATCH] chore!: drop team table --- .../migrations/20230413223931_/migration.sql | 71 +++++++++++++++++++ prisma/schema.prisma | 25 ------- 2 files changed, 71 insertions(+), 25 deletions(-) create mode 100644 prisma/migrations/20230413223931_/migration.sql diff --git a/prisma/migrations/20230413223931_/migration.sql b/prisma/migrations/20230413223931_/migration.sql new file mode 100644 index 000000000..064511022 --- /dev/null +++ b/prisma/migrations/20230413223931_/migration.sql @@ -0,0 +1,71 @@ +/* + Warnings: + + - You are about to drop the column `team` on the `Project` table. All the data in the column will be lost. + - You are about to drop the `Team` table. If the table is not empty, all the data it contains will be lost. + - You are about to drop the `_teamChildren` table. If the table is not empty, all the data it contains will be lost. + - You are about to drop the `_teamParticipants` table. If the table is not empty, all the data it contains will be lost. + - You are about to drop the `_teamProjects` table. If the table is not empty, all the data it contains will be lost. + - You are about to drop the `_teamStargizers` table. If the table is not empty, all the data it contains will be lost. + - You are about to drop the `_teamWatchers` table. If the table is not empty, all the data it contains will be lost. + +*/ +-- DropForeignKey +ALTER TABLE "Goal" DROP CONSTRAINT "Goal_teamId_fkey"; + +-- DropForeignKey +ALTER TABLE "Team" DROP CONSTRAINT "Team_activityId_fkey"; + +-- DropForeignKey +ALTER TABLE "Team" DROP CONSTRAINT "Team_flowId_fkey"; + +-- DropForeignKey +ALTER TABLE "_teamChildren" DROP CONSTRAINT "_teamChildren_A_fkey"; + +-- DropForeignKey +ALTER TABLE "_teamChildren" DROP CONSTRAINT "_teamChildren_B_fkey"; + +-- DropForeignKey +ALTER TABLE "_teamParticipants" DROP CONSTRAINT "_teamParticipants_A_fkey"; + +-- DropForeignKey +ALTER TABLE "_teamParticipants" DROP CONSTRAINT "_teamParticipants_B_fkey"; + +-- DropForeignKey +ALTER TABLE "_teamProjects" DROP CONSTRAINT "_teamProjects_A_fkey"; + +-- DropForeignKey +ALTER TABLE "_teamProjects" DROP CONSTRAINT "_teamProjects_B_fkey"; + +-- DropForeignKey +ALTER TABLE "_teamStargizers" DROP CONSTRAINT "_teamStargizers_A_fkey"; + +-- DropForeignKey +ALTER TABLE "_teamStargizers" DROP CONSTRAINT "_teamStargizers_B_fkey"; + +-- DropForeignKey +ALTER TABLE "_teamWatchers" DROP CONSTRAINT "_teamWatchers_A_fkey"; + +-- DropForeignKey +ALTER TABLE "_teamWatchers" DROP CONSTRAINT "_teamWatchers_B_fkey"; + +-- AlterTable +ALTER TABLE "Project" DROP COLUMN "team"; + +-- DropTable +DROP TABLE "Team"; + +-- DropTable +DROP TABLE "_teamChildren"; + +-- DropTable +DROP TABLE "_teamParticipants"; + +-- DropTable +DROP TABLE "_teamProjects"; + +-- DropTable +DROP TABLE "_teamStargizers"; + +-- DropTable +DROP TABLE "_teamWatchers"; diff --git a/prisma/schema.prisma b/prisma/schema.prisma index 512c2efec..86fdfdacf 100644 --- a/prisma/schema.prisma +++ b/prisma/schema.prisma @@ -110,17 +110,13 @@ model Activity { comments Comment[] reactions Reaction[] projects Project[] - teams Team[] estimates Estimate[] - teamParticipant Team[] @relation("teamParticipants") projectParticipant Project[] @relation("projectParticipants") goalParticipant Goal[] @relation("goalParticipants") goalWatchers Goal[] @relation("goalWatchers") goalStargizers Goal[] @relation("goalStargizers") projectWatchers Project[] @relation("projectWatchers") projectStargizers Project[] @relation("projectStargizers") - teamWatchers Team[] @relation("teamWatchers") - teamStargizers Team[] @relation("teamStargizers") goalOwner Goal[] @relation("goalOwner") goalIssuer Goal[] @relation("goalIssuer") settings Settings @relation(fields: [settingsId], references: [id]) @@ -153,25 +149,6 @@ model Project { updatedAt DateTime @default(now()) @updatedAt } -model Team { - id String @id - title String - description String? - parent Team[] @relation("teamChildren") - children Team[] @relation("teamChildren") - activity Activity @relation(fields: [activityId], references: [id]) - activityId String - participants Activity[] @relation("teamParticipants") - goals Goal[] @relation("teamGoals") - flow Flow? @relation(fields: [flowId], references: [id]) - flowId String? - watchers Activity[] @relation("teamWatchers") - stargizers Activity[] @relation("teamStargizers") - - createdAt DateTime @default(now()) - updatedAt DateTime @default(now()) @updatedAt -} - model Estimate { id Int @id @default(autoincrement()) q String @@ -201,7 +178,6 @@ model Goal { estimate Estimate[] project Project? @relation("projectGoals", fields: [projectId], references: [id]) projectId String? - team Team? @relation("teamGoals", fields: [teamId], references: [id]) teamId String? state State? @relation("goalState", fields: [stateId], references: [id]) stateId String? @@ -267,7 +243,6 @@ model Flow { graph String? // [[stateId, stateId], [stateId, stateId]] — any transition allowed if undefined settings Settings[] projects Project[] - teams Team[] states State[] recommended Boolean?