Skip to content

Commit

Permalink
Add project to schema
Browse files Browse the repository at this point in the history
  • Loading branch information
gramliu committed Dec 4, 2023
1 parent 2622b5c commit d05ac24
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
14 changes: 13 additions & 1 deletion packages/database/prisma/schema.prisma
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ model Repository {
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
pages Page[]
project Project?
}

model Page {
Expand All @@ -33,10 +34,21 @@ model Page {
name String
standaloneCode String?
screenshotPath String?
screenshotPath String?
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
@@unique([repositoryId, canvasPageId])
}

model Project {
id String @id @map("_id")
repositoryId String @unique
repository Repository @relation(fields: [repositoryId], references: [id])
branch String
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
}
1 change: 1 addition & 0 deletions packages/database/src/prefixed_id.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ export function generatePrefixedId(prefix: IDPrefix): string {
* Mapping of ID prefixes
*/
export const ID_PREFIXES = {
PROJECT: "proj",
REPOSITORY: "repo",
PAGE: "pg"
} as const;
Expand Down

0 comments on commit d05ac24

Please sign in to comment.