-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from fumeapp/more-tests
✨ complete user cartridge coverage
- Loading branch information
Showing
26 changed files
with
1,087 additions
and
960 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
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
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
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
Large diffs are not rendered by default.
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
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 |
---|---|---|
@@ -1,39 +1,41 @@ | ||
|
||
model Cartridge { | ||
id BigInt @id @default(autoincrement()) | ||
id BigInt @id @default(autoincrement()) | ||
userId BigInt | ||
user User @relation(fields: [userId], references: [id]) | ||
content String | ||
ml Decimal | ||
mg Decimal | ||
shots Shot[] | ||
pen Pen? | ||
user User @relation(fields: [userId], references: [id]) | ||
content String | ||
ml Decimal | ||
mg Decimal | ||
shots Shot[] | ||
pen Pen? | ||
createdAt DateTime @default(now()) | ||
updatedAt DateTime @updatedAt | ||
@@map("cartridges") | ||
} | ||
|
||
model Pen { | ||
id BigInt @id @default(autoincrement()) | ||
user User @relation(fields: [userId], references: [id]) | ||
userId BigInt | ||
cartridge Cartridge? @relation(fields: [cartridgeId], references: [id], onDelete: Restrict ) | ||
cartridgeId BigInt? @unique | ||
color String | ||
createdAt DateTime @default(now()) | ||
updatedAt DateTime @updatedAt | ||
id BigInt @id @default(autoincrement()) | ||
user User @relation(fields: [userId], references: [id]) | ||
userId BigInt | ||
cartridge Cartridge? @relation(fields: [cartridgeId], references: [id], onDelete: Restrict) | ||
cartridgeId BigInt? @unique | ||
color String | ||
createdAt DateTime @default(now()) | ||
updatedAt DateTime @updatedAt | ||
@@map("pens") | ||
} | ||
|
||
model Shot { | ||
id BigInt @id @default(autoincrement()) | ||
userId BigInt | ||
user User @relation(fields: [userId], references: [id]) | ||
id BigInt @id @default(autoincrement()) | ||
userId BigInt | ||
user User @relation(fields: [userId], references: [id]) | ||
cartridgeId BigInt | ||
cartridge Cartridge @relation(fields: [cartridgeId], references: [id], onDelete: Cascade, onUpdate: Cascade ) | ||
units Int | ||
date DateTime | ||
createdAt DateTime @default(now()) | ||
updatedAt DateTime @updatedAt | ||
cartridge Cartridge @relation(fields: [cartridgeId], references: [id], onDelete: Cascade, onUpdate: Cascade) | ||
units Int | ||
date DateTime | ||
createdAt DateTime @default(now()) | ||
updatedAt DateTime @updatedAt | ||
@@map("shots") | ||
} |
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
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 |
---|---|---|
@@ -1,44 +1,47 @@ | ||
model User { | ||
id BigInt @id @default(autoincrement()) | ||
email String @unique | ||
name String? | ||
avatar String? @db.VarChar(1600) | ||
providers Provider[] | ||
sessions Token[] | ||
pens Pen[] | ||
cartridges Cartridge[] | ||
shots Shot[] | ||
payload Json | ||
createdAt DateTime @default(now()) | ||
updatedAt DateTime @updatedAt | ||
id BigInt @id @default(autoincrement()) | ||
email String @unique | ||
name String? | ||
avatar String? @db.VarChar(1600) | ||
providers Provider[] | ||
sessions Token[] | ||
pens Pen[] | ||
cartridges Cartridge[] | ||
shots Shot[] | ||
payload Json | ||
createdAt DateTime @default(now()) | ||
updatedAt DateTime @updatedAt | ||
@@map("users") | ||
} | ||
|
||
model Provider { | ||
id BigInt @id @default(autoincrement()) | ||
id BigInt @id @default(autoincrement()) | ||
userId BigInt | ||
user User @relation(fields: [userId], references: [id]) | ||
name String? | ||
avatar String? @db.VarChar(1600) | ||
payload Json | ||
user User @relation(fields: [userId], references: [id]) | ||
name String? | ||
avatar String? @db.VarChar(1600) | ||
payload Json | ||
createdAt DateTime @default(now()) | ||
updatedAt DateTime @updatedAt | ||
@@map("providers") | ||
@@unique([userId, name]) | ||
@@map("providers") | ||
} | ||
|
||
model Token { | ||
id BigInt @id @default(autoincrement()) | ||
userId BigInt | ||
user User @relation(fields: [userId], references: [id]) | ||
hash String @unique | ||
source String | ||
ip String | ||
agent String | ||
location Json | ||
id BigInt @id @default(autoincrement()) | ||
userId BigInt | ||
user User @relation(fields: [userId], references: [id]) | ||
hash String @unique | ||
source String | ||
ip String | ||
agent String | ||
location Json | ||
// coordinate Unsupported("Point") | ||
coordinate String @default("30.2423 -97.7672") | ||
createdAt DateTime @default(now()) | ||
updatedAt DateTime @updatedAt | ||
coordinate String @default("30.2423 -97.7672") | ||
createdAt DateTime @default(now()) | ||
updatedAt DateTime @updatedAt | ||
@@map("tokens") | ||
} |
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
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
Oops, something went wrong.