Skip to content

Commit

Permalink
fix: makes sure sync doesn't overwrite
Browse files Browse the repository at this point in the history
  • Loading branch information
AssisrMatheus committed Apr 27, 2022
1 parent e5c1712 commit 8554b56
Show file tree
Hide file tree
Showing 9 changed files with 802 additions and 97 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
-- AddForeignKey
ALTER TABLE `Module` ADD FOREIGN KEY (`ownerExternalId`) REFERENCES `Module`(`externalId`) ON DELETE SET NULL ON UPDATE CASCADE;
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
-- AlterTable
ALTER TABLE `List` ADD COLUMN `createdAt` DATETIME(0) DEFAULT CURRENT_TIMESTAMP(0),
ADD COLUMN `updatedAt` DATETIME(0) DEFAULT CURRENT_TIMESTAMP(0);
10 changes: 7 additions & 3 deletions prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -86,11 +86,13 @@ model FinishTranslations {
}

model List {
id Int @id @default(autoincrement())
externalId String? @unique
id Int @id @default(autoincrement())
externalId String? @unique
name String?
createdAt DateTime? @default(now()) @db.DateTime(0)
updatedAt DateTime? @default(now()) @updatedAt @db.DateTime(0)
projectId Int?
project Project? @relation(fields: [projectId], references: [id])
project Project? @relation(fields: [projectId], references: [id])
}

model ModuleAttachments {
Expand All @@ -106,6 +108,7 @@ model Module {
partNumber String @unique
externalId String? @unique
ownerExternalId String?
owner Module? @relation("ownerRelation", fields: [ownerExternalId], references: [externalId])
description String?
thumbnailUrl String? @db.VarChar(255)
bundleUrl String? @db.VarChar(255)
Expand Down Expand Up @@ -139,6 +142,7 @@ model Module {
moduleAttachments ModuleAttachments[] @relation("module_moduleAttachments")
moduleAttachedTo ModuleAttachments[] @relation("attachment_moduleAttachments")
moduleType ModuleType[]
modulesIOwn Module[] @relation("ownerRelation")
}

model Project {
Expand Down
28 changes: 18 additions & 10 deletions src/generated/nexus-prisma.d.ts

Large diffs are not rendered by default.

364 changes: 339 additions & 25 deletions src/generated/nexus.d.ts

Large diffs are not rendered by default.

Loading

0 comments on commit 8554b56

Please sign in to comment.