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
fix: Transaction log, add preview/production/local to hooks (#2623)
Ivan Starkova326ae5b1d9f
diff --git a/apps/builder/app/routes/n8n.$.tsx b/apps/builder/app/routes/n8n.$.tsxindex 7947aad4f9..67a3700400 100644--- a/apps/builder/app/routes/n8n.$.tsx+++ b/apps/builder/app/routes/n8n.$.tsx@@ -44,7 +44,9 @@ export const loader = async ({ request, params }: LoaderArgs) => {const webhookEnv = webhookEnvParsed.data;const n8nWebhookUrl = new URL(webhookEnv.N8N_WEBHOOK_URL);- n8nWebhookUrl.pathname = `${n8nWebhookUrl.pathname}/${params["*"]}`+ n8nWebhookUrl.pathname = `${n8nWebhookUrl.pathname}/${+ env.DEPLOYMENT_ENVIRONMENT ?? "local"+ }/${params["*"]}`.split("/").filter(Boolean).join("/");diff --git a/packages/prisma-client/prisma/migrations/20231116174151_transaction/migration.sql b/packages/prisma-client/prisma/migrations/20231116174151_transaction/migration.sqldeleted file mode 100644index a4e46f6f6a..0000000000--- a/packages/prisma-client/prisma/migrations/20231116174151_transaction/migration.sql+++ /dev/null@@ -1,3 +0,0 @@--- AlterTable-ALTER TABLE "TransactionLog" DROP CONSTRAINT "TransactionLog_pkey",-DROP COLUMN "id";diff --git a/packages/prisma-client/prisma/migrations/20231117095612_transaction/migration.sql b/packages/prisma-client/prisma/migrations/20231117095612_transaction/migration.sqlnew file mode 100644index 0000000000..d9d5803a09--- /dev/null+++ b/packages/prisma-client/prisma/migrations/20231117095612_transaction/migration.sql@@ -0,0 +1,29 @@+-- DropIndex+DROP INDEX "ClientReferences_userId_service_key";++-- AlterTable+ALTER TABLE "ClientReferences" DROP CONSTRAINT "ClientReferences_pkey",+DROP COLUMN "id",+ADD CONSTRAINT "ClientReferences_pkey" PRIMARY KEY ("userId", "service");++-- CreateTable+CREATE TABLE "TransactionLog" (+ "eventId" TEXT NOT NULL,+ "sessionId" TEXT NOT NULL,+ "productId" TEXT NOT NULL,+ "userId" TEXT NOT NULL,+ "status" TEXT NOT NULL,+ "createdAt" TIMESTAMP(3) NOT NULL DEFAULT CURRENT_TIMESTAMP+);++-- CreateIndex+CREATE UNIQUE INDEX "TransactionLog_eventId_productId_key" ON "TransactionLog"("eventId", "productId");++-- CreateIndex+CREATE UNIQUE INDEX "TransactionLog_sessionId_productId_key" ON "TransactionLog"("sessionId", "productId");++-- AddForeignKey+ALTER TABLE "TransactionLog" ADD CONSTRAINT "TransactionLog_productId_fkey" FOREIGN KEY ("productId") REFERENCES "Product"("id") ON DELETE RESTRICT ON UPDATE CASCADE;++-- AddForeignKey+ALTER TABLE "TransactionLog" ADD CONSTRAINT "TransactionLog_userId_fkey" FOREIGN KEY ("userId") REFERENCES "User"("id") ON DELETE RESTRICT ON UPDATE CASCADE;diff --git a/packages/prisma-client/prisma/schema.prisma b/packages/prisma-client/prisma/schema.prismaindex bfd5b714c2..11eaf2a431 100644--- a/packages/prisma-client/prisma/schema.prisma+++ b/packages/prisma-client/prisma/schema.prisma@@ -65,16 +65,13 @@ model User {// User client references in external services like stripe etcmodel ClientReferences {- id String @id @default(uuid())- // userId String- //user User @relation(fields: [userId], references: [id])- reference String @default(uuid())+ reference String @default(dbgenerated())service StringcreatedAt DateTime @default(now())user User @relation(fields: [userId], references: [id])userId String- @@unique([userId, service])+ @@id([userId, service])@@unique([reference, service])}