Skip to content

Commit

Permalink
feat(Team): add flow field
Browse files Browse the repository at this point in the history
  • Loading branch information
awinogradov committed Jan 20, 2023
1 parent eebc40a commit 1f91cd8
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
2 changes: 2 additions & 0 deletions graphql/schema.graphql
Original file line number Diff line number Diff line change
Expand Up @@ -364,6 +364,8 @@ type Team {
children: [Team]
createdAt: DateTime!
description: String
flow: Flow
flowId: String
goals: [Goal]
id: Int!
parent: Team
Expand Down
2 changes: 2 additions & 0 deletions graphql/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,8 @@ export const Team = objectType({
t.field(TeamModel.title);
t.field(TeamModel.description);
t.field(TeamModel.activityId);
t.field(TeamModel.flowId);
t.field('flow', { type: Flow });
t.field('activity', { type: Activity });
t.field('parent', { type: Team });
t.list.field('children', { type: Team });
Expand Down
5 changes: 5 additions & 0 deletions prisma/migrations/20230112185149_/migration.sql
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
-- AlterTable
ALTER TABLE "Team" ADD COLUMN "flowId" TEXT;

-- AddForeignKey
ALTER TABLE "Team" ADD CONSTRAINT "Team_flowId_fkey" FOREIGN KEY ("flowId") REFERENCES "Flow"("id") ON DELETE SET NULL ON UPDATE CASCADE;
3 changes: 3 additions & 0 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,8 @@ model Team {
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")
Expand Down Expand Up @@ -272,6 +274,7 @@ 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 1f91cd8

Please sign in to comment.