Skip to content

Commit

Permalink
chore!: drop team table
Browse files Browse the repository at this point in the history
  • Loading branch information
awinogradov committed Apr 13, 2023
1 parent f9c5b17 commit 24bdf98
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 25 deletions.
71 changes: 71 additions & 0 deletions prisma/migrations/20230413223931_/migration.sql
Original file line number Diff line number Diff line change
@@ -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";
25 changes: 0 additions & 25 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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?
Expand Down Expand Up @@ -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?
Expand Down

0 comments on commit 24bdf98

Please sign in to comment.