Move migration to separate PR

This commit is contained in:
Alan 2023-02-03 17:22:25 -07:00
parent 373b4bc88d
commit 48aa64e072
2 changed files with 10 additions and 22 deletions

View File

@ -1,15 +0,0 @@
/*
Warnings:
- You are about to drop the column `type` on the `Payment` table. All the data in the column will be lost.
*/
-- AlterTable
ALTER TABLE "Payment" DROP COLUMN "type",
ADD COLUMN "appId" TEXT;
-- DropEnum
DROP TYPE "PaymentType";
-- AddForeignKey
ALTER TABLE "Payment" ADD CONSTRAINT "Payment_appId_fkey" FOREIGN KEY ("appId") REFERENCES "App"("slug") ON DELETE CASCADE ON UPDATE CASCADE;

View File

@ -399,20 +399,24 @@ model ReminderMail {
createdAt DateTime @default(now())
}
enum PaymentType {
STRIPE
}
model Payment {
id Int @id @default(autoincrement())
uid String @unique
app App? @relation(fields: [appId], references: [slug], onDelete: Cascade)
appId String?
id Int @id @default(autoincrement())
uid String @unique
// TODO: Use an App relationship instead of PaymentType enum?
type PaymentType
bookingId Int
booking Booking? @relation(fields: [bookingId], references: [id], onDelete: Cascade)
booking Booking? @relation(fields: [bookingId], references: [id], onDelete: Cascade)
amount Int
fee Int
currency String
success Boolean
refunded Boolean
data Json
externalId String @unique
externalId String @unique
}
enum WebhookTriggerEvents {
@ -521,7 +525,6 @@ model App {
createdAt DateTime @default(now())
updatedAt DateTime @updatedAt
credentials Credential[]
payments Payment[]
Webhook Webhook[]
ApiKey ApiKey[]
enabled Boolean @default(false)