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
add timeout to other migrations
Roman Pominovb7914b96c45f
diff --git a/packages/prisma-client/migrations-cli/TROUBLESHOOTING.md b/packages/prisma-client/migrations-cli/TROUBLESHOOTING.mdindex 46a50de3f8..b138d0b524 100644--- a/packages/prisma-client/migrations-cli/TROUBLESHOOTING.md+++ b/packages/prisma-client/migrations-cli/TROUBLESHOOTING.md@@ -22,7 +22,7 @@ prisma.$transaction(// Code running in a transaction...},{- timeout: 1000 * 60, // in milliseconds, default 5000+ timeout: 1000 * 60 * 2, // in milliseconds, default 5000});```diff --git a/packages/prisma-client/prisma/migrations/20220909124542_builds-data/migration.ts b/packages/prisma-client/prisma/migrations/20220909124542_builds-data/migration.tsindex 2df896a683..382918738f 100644--- a/packages/prisma-client/prisma/migrations/20220909124542_builds-data/migration.ts+++ b/packages/prisma-client/prisma/migrations/20220909124542_builds-data/migration.ts@@ -23,46 +23,49 @@ export default () => {// Uncomment to see the queries in console as the migration runs// log: ["query", "info", "warn", "error"],});- return client.$transaction(async (prisma) => {- const trees = await prisma.tree.findMany();- const projects = await prisma.project.findMany();+ return client.$transaction(+ async (prisma) => {+ const trees = await prisma.tree.findMany();+ const projects = await prisma.project.findMany();- const builds: Prisma.BuildCreateManyInput[] = [];+ const builds: Prisma.BuildCreateManyInput[] = [];- for (const tree of trees) {- const project = projects.find(- (project) =>- project.devTreeId === tree.id ||- project.prodTreeId === tree.id ||- TreeHistorySchema.parse(- JSON.parse(project.prodTreeIdHistory)- ).includes(tree.id)- );+ for (const tree of trees) {+ const project = projects.find(+ (project) =>+ project.devTreeId === tree.id ||+ project.prodTreeId === tree.id ||+ TreeHistorySchema.parse(+ JSON.parse(project.prodTreeIdHistory)+ ).includes(tree.id)+ );- if (project === undefined) {- continue;- }+ if (project === undefined) {+ continue;+ }- const pages = PagesSchema.parse({- homePage: {- id: uuid(),- name: "Home",- path: "",- title: "Home",- meta: {},- treeId: tree.id,- },- pages: [],- });+ const pages = PagesSchema.parse({+ homePage: {+ id: uuid(),+ name: "Home",+ path: "",+ title: "Home",+ meta: {},+ treeId: tree.id,+ },+ pages: [],+ });- builds.push({- pages: JSON.stringify(pages),- isDev: project.devTreeId === tree.id,- isProd: project.prodTreeId === tree.id,- projectId: project.id,- });- }+ builds.push({+ pages: JSON.stringify(pages),+ isDev: project.devTreeId === tree.id,+ isProd: project.prodTreeId === tree.id,+ projectId: project.id,+ });+ }- await prisma.build.createMany({ data: builds });- });+ await prisma.build.createMany({ data: builds });+ },+ { timeout: 1000 * 60 }+ );};diff --git a/packages/prisma-client/prisma/migrations/20220912142938_assets-meta-data/migration.ts b/packages/prisma-client/prisma/migrations/20220912142938_assets-meta-data/migration.tsindex 0652f5fe03..43b7920027 100644--- a/packages/prisma-client/prisma/migrations/20220912142938_assets-meta-data/migration.ts+++ b/packages/prisma-client/prisma/migrations/20220912142938_assets-meta-data/migration.ts@@ -31,6 +31,6 @@ export default () => {));},- { timeout: 1000 * 60 * 5 }+ { timeout: 1000 * 60 });};diff --git a/packages/prisma-client/prisma/migrations/20220915144008_breakpoints-build_data/migration.ts b/packages/prisma-client/prisma/migrations/20220915144008_breakpoints-build_data/migration.tsindex 0a7eefa820..e6f38ae448 100644--- a/packages/prisma-client/prisma/migrations/20220915144008_breakpoints-build_data/migration.ts+++ b/packages/prisma-client/prisma/migrations/20220915144008_breakpoints-build_data/migration.ts@@ -20,34 +20,37 @@ export default () => {// Uncomment to see the queries in console as the migration runs// log: ["query", "info", "warn", "error"],});- return client.$transaction(async (prisma) => {- const builds = await prisma.build.findMany();- const breakpoints = await prisma.breakpoints.findMany();+ return client.$transaction(+ async (prisma) => {+ const builds = await prisma.build.findMany();+ const breakpoints = await prisma.breakpoints.findMany();- const buildsParsed = builds.map((build) => ({- id: build.id,- pages: PagesSchema.parse(JSON.parse(build.pages)),- }));+ const buildsParsed = builds.map((build) => ({+ id: build.id,+ pages: PagesSchema.parse(JSON.parse(build.pages)),+ }));- await Promise.all(- breakpoints.map((breakpoint) => {- const build = buildsParsed.find(- (build) => build.pages.homePage.treeId === breakpoint.treeId- );-- if (build === undefined) {- throw new Error(- `Build not found for breakpoint ${breakpoint.treeId}`+ await Promise.all(+ breakpoints.map((breakpoint) => {+ const build = buildsParsed.find(+ (build) => build.pages.homePage.treeId === breakpoint.treeId);- }- return prisma.breakpoints.update({- where: { treeId: breakpoint.treeId },- data: {- buildId: build.id,- },- });- })- );- });+ if (build === undefined) {+ throw new Error(+ `Build not found for breakpoint ${breakpoint.treeId}`+ );+ }++ return prisma.breakpoints.update({+ where: { treeId: breakpoint.treeId },+ data: {+ buildId: build.id,+ },+ });+ })+ );+ },+ { timeout: 1000 * 60 }+ );};diff --git a/packages/prisma-client/prisma/migrations/template.txt b/packages/prisma-client/prisma/migrations/template.txtindex b63e297a0f..c330e9dabd 100644--- a/packages/prisma-client/prisma/migrations/template.txt+++ b/packages/prisma-client/prisma/migrations/template.txt@@ -33,5 +33,5 @@ export default () => {// NOTE:// Don't do any schema modifications here like adding a column to a table!// If you need to change schema, edit schema.prisma and create a schema migration.- });+ }, { timeout: 1000 * 60 });};