-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a144a56
commit c0194f7
Showing
6 changed files
with
151 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -46,4 +46,7 @@ next-env.d.ts | |
|
||
# Diagrams and Drawings | ||
*.xcf | ||
*.png | ||
*.png | ||
|
||
# Prisma Database | ||
prisma/dev* |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
29 changes: 29 additions & 0 deletions
29
prisma/migrations/20240710193430_initial_migration/migration.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
-- CreateTable | ||
CREATE TABLE "Team" ( | ||
"id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT, | ||
"name" TEXT NOT NULL | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Entry" ( | ||
"id" TEXT NOT NULL PRIMARY KEY, | ||
"type" TEXT NOT NULL, | ||
"teamNumber" INTEGER NOT NULL, | ||
"createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP, | ||
CONSTRAINT "Entry_teamNumber_fkey" FOREIGN KEY ("teamNumber") REFERENCES "Team" ("id") ON DELETE CASCADE ON UPDATE CASCADE | ||
); | ||
|
||
-- CreateTable | ||
CREATE TABLE "Image" ( | ||
"id" TEXT NOT NULL PRIMARY KEY, | ||
"uploadedAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP | ||
); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Team_id_key" ON "Team"("id"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Entry_id_key" ON "Entry"("id"); | ||
|
||
-- CreateIndex | ||
CREATE UNIQUE INDEX "Image_id_key" ON "Image"("id"); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Please do not edit this file manually | ||
# It should be added in your version-control system (i.e. Git) | ||
provider = "sqlite" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
generator client { | ||
provider = "prisma-client-js" | ||
} | ||
|
||
datasource db { | ||
provider = "sqlite" | ||
url = "file:./dev.db" | ||
} | ||
|
||
model Team { | ||
id Int @id @unique | ||
name String | ||
entries Entry[] | ||
} | ||
|
||
model Entry { | ||
id String @id @unique @default(cuid()) | ||
type String | ||
teamNumber Int | ||
team Team @relation(fields: [teamNumber], references: [id], onUpdate: Cascade, onDelete: Cascade) | ||
createdAt DateTime @default(now()) | ||
} | ||
|
||
model Image { | ||
id String @id @unique @default(cuid()) | ||
uploadedAt DateTime @default(now()) | ||
} |