Move migration to separate PR

pull/6677/head
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,11 +399,15 @@ model ReminderMail {
createdAt DateTime @default(now()) createdAt DateTime @default(now())
} }
enum PaymentType {
STRIPE
}
model Payment { model Payment {
id Int @id @default(autoincrement()) id Int @id @default(autoincrement())
uid String @unique uid String @unique
app App? @relation(fields: [appId], references: [slug], onDelete: Cascade) // TODO: Use an App relationship instead of PaymentType enum?
appId String? type PaymentType
bookingId Int bookingId Int
booking Booking? @relation(fields: [bookingId], references: [id], onDelete: Cascade) booking Booking? @relation(fields: [bookingId], references: [id], onDelete: Cascade)
amount Int amount Int
@ -521,7 +525,6 @@ model App {
createdAt DateTime @default(now()) createdAt DateTime @default(now())
updatedAt DateTime @updatedAt updatedAt DateTime @updatedAt
credentials Credential[] credentials Credential[]
payments Payment[]
Webhook Webhook[] Webhook Webhook[]
ApiKey ApiKey[] ApiKey ApiKey[]
enabled Boolean @default(false) enabled Boolean @default(false)