Created
January 13, 2023 04:41
-
-
Save dipeshhkc/41848a6d1e424b9edbd467e265ab52fe to your computer and use it in GitHub Desktop.
This file contains hidden or 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 is your Prisma schema file, | |
// learn more about it in the docs: https://pris.ly/d/prisma-schema | |
generator client { | |
provider = "prisma-client-js" | |
} | |
datasource db { | |
provider = "postgresql" | |
url = env("DATABASE_URL") | |
} | |
model User { | |
id Int @id @default(autoincrement()) | |
email String @unique | |
subscription_id Int? | |
trial_ends_at DateTime? | |
created_at DateTime @default(now()) | |
updated_at DateTime @default(now()) @updatedAt | |
subscription Subscription? @relation(fields: [subscription_id], references: [id]) | |
@@map("users") | |
} | |
model Subscription { | |
id Int @id @default(autoincrement()) | |
stripe_subscription_id String | |
stripe_customer_id String | |
stripe_plan_id String | |
stripe_plan_name String? | |
stripe_status String? | |
ends_at DateTime? | |
userId Int | |
created_at DateTime @default(now()) | |
updated_at DateTime @default(now()) @updatedAt | |
User User[] | |
@@map("subscriptions") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment