Open source website builder and Webflow alternative. Webstudio is an advanced visual builder that connects to any headless CMS, supports all CSS properties, and can be hosted anywhere, including with us.
TypeScript accessibilityalternativecloudflarecloudflare-workersdesignfreefrontendopen-sourceradix-uireactremixweb-developmentwebflowwebsite-builderwebsite-developmentwebsiteswebstudio
feat: Appsumo support (#2759)
Ivan Starkova8918a70d203
diff --git a/packages/prisma-client/prisma/migrations/20240112155724_nullable-user/migration.sql b/packages/prisma-client/prisma/migrations/20240112155724_nullable-user/migration.sqlnew file mode 100644index 0000000000..faaa85a5de--- /dev/null+++ b/packages/prisma-client/prisma/migrations/20240112155724_nullable-user/migration.sql@@ -0,0 +1,8 @@+-- DropForeignKey+ALTER TABLE "TransactionLog" DROP CONSTRAINT "TransactionLog_userId_fkey";++-- AlterTable+ALTER TABLE "TransactionLog" ALTER COLUMN "userId" DROP NOT NULL;++-- AddForeignKey+ALTER TABLE "TransactionLog" ADD CONSTRAINT "TransactionLog_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE SET NULL ON UPDATE CASCADE;diff --git a/packages/prisma-client/prisma/migrations/20240112155725_user_product_view/migration.sql b/packages/prisma-client/prisma/migrations/20240112155725_user_product_view/migration.sqlnew file mode 100644index 0000000000..7f0dadcba3--- /dev/null+++ b/packages/prisma-client/prisma/migrations/20240112155725_user_product_view/migration.sql@@ -0,0 +1,47 @@+CREATE OR REPLACE VIEW "UserProduct" AS (+ SELECT+ "userId",+ "subscriptionId",+ "productId",+ "customerId",+ "customerEmail"+ FROM+ "TransactionLog" AS tl+ WHERE+ "status" = 'complete'+ AND "eventType" = 'checkout.session.completed'+ AND NOT EXISTS (+ SELECT+ 1+ FROM+ "TransactionLog" AS tlexsists+ WHERE+ tlexsists."subscriptionId" = tl."subscriptionId"+ AND tlexsists."eventType" = 'customer.subscription.deleted'+ AND tlexsists."status" = 'canceled'+ AND tlexsists."eventCreated" > tl."eventCreated")+ AND NOT EXISTS (+ SELECT+ 1+ FROM+ "TransactionLog" AS tlexsists+ WHERE+ tlexsists."paymentIntent" = tl."paymentIntent"+ AND tlexsists."eventType" = 'charge.refunded'+ AND tlexsists."status" = 'succeeded'+ AND tlexsists."eventCreated" > tl."eventCreated")+ ORDER BY+ "userId",+ "eventCreated" DESC)+ UNION ALL (+ SELECT+ "userId",+ "subscriptionId",+ "productId",+ "customerId",+ "customerEmail"+ FROM+ "TransactionLog"+ WHERE+ "eventType" = 'appsumo.activate');+diff --git a/packages/prisma-client/prisma/schema.prisma b/packages/prisma-client/prisma/schema.prismaindex 1c51e07130..0ab2e6dbf3 100644--- a/packages/prisma-client/prisma/schema.prisma+++ b/packages/prisma-client/prisma/schema.prisma@@ -91,9 +91,9 @@ model Product {model TransactionLog {// Stripe event id (debug and idempotency purposes)- eventId String @id- userId String- user User @relation(fields: [userId], references: [id])+ eventId String @id+ userId String?+ user User? @relation(fields: [userId], references: [id])productId String?product Product? @relation(fields: [productId], references: [id])