Skip to content

Commit 48aa64e

Browse files
committed
Move migration to separate PR
1 parent 373b4bc commit 48aa64e

2 files changed

Lines changed: 10 additions & 22 deletions

File tree

packages/prisma/migrations/20230125175109_remove_type_from_payment_and_add_app_relationship/migration.sql

Lines changed: 0 additions & 15 deletions
This file was deleted.

packages/prisma/schema.prisma

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -399,20 +399,24 @@ model ReminderMail {
399399
createdAt DateTime @default(now())
400400
}
401401

402+
enum PaymentType {
403+
STRIPE
404+
}
405+
402406
model Payment {
403-
id Int @id @default(autoincrement())
404-
uid String @unique
405-
app App? @relation(fields: [appId], references: [slug], onDelete: Cascade)
406-
appId String?
407+
id Int @id @default(autoincrement())
408+
uid String @unique
409+
// TODO: Use an App relationship instead of PaymentType enum?
410+
type PaymentType
407411
bookingId Int
408-
booking Booking? @relation(fields: [bookingId], references: [id], onDelete: Cascade)
412+
booking Booking? @relation(fields: [bookingId], references: [id], onDelete: Cascade)
409413
amount Int
410414
fee Int
411415
currency String
412416
success Boolean
413417
refunded Boolean
414418
data Json
415-
externalId String @unique
419+
externalId String @unique
416420
}
417421

418422
enum WebhookTriggerEvents {
@@ -521,7 +525,6 @@ model App {
521525
createdAt DateTime @default(now())
522526
updatedAt DateTime @updatedAt
523527
credentials Credential[]
524-
payments Payment[]
525528
Webhook Webhook[]
526529
ApiKey ApiKey[]
527530
enabled Boolean @default(false)

0 commit comments

Comments
 (0)