mirror of
https://github.com/lukevella/rallly.git
synced 2025-07-23 03:07:25 +02:00
✨ Keep payment methods synchronized (#1569)
This commit is contained in:
parent
5e356afab6
commit
ca46b18f3a
20 changed files with 566 additions and 346 deletions
|
@ -51,12 +51,13 @@ model User {
|
|||
customerId String? @map("customer_id")
|
||||
subscriptionId String? @unique @map("subscription_id")
|
||||
|
||||
comments Comment[]
|
||||
polls Poll[]
|
||||
watcher Watcher[]
|
||||
events Event[]
|
||||
accounts Account[]
|
||||
participants Participant[]
|
||||
comments Comment[]
|
||||
polls Poll[]
|
||||
watcher Watcher[]
|
||||
events Event[]
|
||||
accounts Account[]
|
||||
participants Participant[]
|
||||
paymentMethods PaymentMethod[]
|
||||
|
||||
subscription Subscription? @relation(fields: [subscriptionId], references: [id], onDelete: SetNull)
|
||||
|
||||
|
@ -82,6 +83,19 @@ enum SubscriptionInterval {
|
|||
@@map("subscription_interval")
|
||||
}
|
||||
|
||||
model PaymentMethod {
|
||||
id String @id
|
||||
userId String @map("user_id")
|
||||
type String
|
||||
data Json
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
updatedAt DateTime @updatedAt @map("updated_at")
|
||||
|
||||
user User @relation(fields: [userId], references: [id], onDelete: Cascade)
|
||||
|
||||
@@map("payment_methods")
|
||||
}
|
||||
|
||||
model UserPaymentData {
|
||||
userId String @id @map("user_id")
|
||||
subscriptionId String @map("subscription_id")
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue