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
A migration failed in PREVIEW, how do I fix the PREVIEW database
- Open a new PR where you'll do the fix
- Go to https://vercel.com/webstudio-is/webstudio/settings/environment-variables
- Set APPLY_MIGRATIONS to "true" for your PR's branch
- Fix the failed migration code
- Fix the database mannually if the migration have been applied half-way
- Temporarily change
ci:migratescript to runresolvebefore applying migrations:"ci:migrate": "migrations resolve rolled-back <name> --force && migrations migrate". Useappliedinstead ofrolled-backif you manually applied the migration at previous step. - Commit the changes and check Vercel logs to see if the migration is applied
- Change
ci:migratescript back to normal - Merge the PR
- Remove APPLY_MIGRATIONS from Vercel settings for your branch
Transacation failed with a error "Transaction API error: Transaction already closed: Could not perform operation."
Most likely reason Prisma has thrown this error is because transaction has timed out. If that's the case, you have the following options:
- Optimize your migration to make it faster
- Increase the timeout:
export default () => {
const client = new PrismaClient();
return client.$transaction(
async (prisma) => {
// migration code...
},
{
timeout: 1000 * 60 * 2, // in milliseconds, default 5000
}
);
};
- Do not wrap the migration body into a transaction:
export default async () => {
const prisma = new PrismaClient();
// use `prisma` here without wrapping it into a transaction
};
Note that in this case if the migration fails again, it will be harder to fix the database, because the migration can end up half-way applied.