Migrate billing backend from Django to Express + Apollo Server + Prisma
All checks were successful
Build Docker Image / build (push) Successful in 1m44s
All checks were successful
Build Docker Image / build (push) Successful in 1m44s
Replace Python/Django/Graphene with TypeScript/Express/Apollo Server. Same 2 endpoints (team/m2m), same JWT auth, same TigerBeetle integration. Prisma ORM replaces Django ORM for Account/OperationCode/ServiceAccount.
This commit is contained in:
43
prisma/schema.prisma
Normal file
43
prisma/schema.prisma
Normal file
@@ -0,0 +1,43 @@
|
||||
generator client {
|
||||
provider = "prisma-client-js"
|
||||
}
|
||||
|
||||
datasource db {
|
||||
provider = "postgresql"
|
||||
url = env("BILLING_DATABASE_URL")
|
||||
}
|
||||
|
||||
enum AccountType {
|
||||
USER
|
||||
SERVICE
|
||||
}
|
||||
|
||||
model Account {
|
||||
uuid String @id @default(uuid()) @db.Uuid
|
||||
name String @db.VarChar(255)
|
||||
accountType AccountType @default(USER) @map("account_type")
|
||||
description String?
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
|
||||
serviceInfo ServiceAccount?
|
||||
|
||||
@@map("billing_app_account")
|
||||
}
|
||||
|
||||
model OperationCode {
|
||||
id Int @id @default(autoincrement())
|
||||
code Int @unique
|
||||
name String @unique @db.VarChar(255)
|
||||
description String?
|
||||
createdAt DateTime @default(now()) @map("created_at")
|
||||
|
||||
@@map("billing_app_operationcode")
|
||||
}
|
||||
|
||||
model ServiceAccount {
|
||||
accountUuid String @id @map("account_id") @db.Uuid
|
||||
slug String @unique @db.VarChar(50)
|
||||
account Account @relation(fields: [accountUuid], references: [uuid], onDelete: Cascade)
|
||||
|
||||
@@map("billing_app_serviceaccount")
|
||||
}
|
||||
Reference in New Issue
Block a user