Migrate: 'prisma2 migrate up' causes error

Created on 7 Feb 2020  路  7Comments  路  Source: prisma/migrate

I'm trying to create database schema with prisma2 migrate
so when I running

prisma2 migrate up --experimental

it shows an error below

ERROR  Oops, an unexpected error occured!
Failure during a migration command: Connector error. (error: Error querying the database: Error querying the database: Err
or querying the database: Server error: `ERROR 42S02 (1146): Table '{SchemaName}._migration' doesn't exist')

My prisma2 version:
"prisma2": "^2.0.0-preview020.3",

bu0-needs-info kinbug

All 7 comments

Are you on windows? If yes, this would be a duplicate of https://github.com/prisma/migrate/issues/339 which is confirmed bug.

No I'm on mac os

@ifndefdeadmau5 In that case, can you please share your schema? Also, please make sure that the database that you are using is not hosted on a windows machine with InnoDB mysql engine.

@pantharshit00 Was using local mysql instance, and what'd be the best way to share my schema?
Can you give me your email address

EDIT: Now I think of it, I guess my old mysql version could be the reason it's 5.5 right now

Same error. checked the postgres logs:

postgres_1         | 2020-02-14T10:18:00.663306288Z 2020-02-14 10:18:00.662 UTC [38] ERROR:  relation "_Migration" already exists
postgres_1         | 2020-02-14T10:18:00.663384955Z 2020-02-14 10:18:00.662 UTC [38] STATEMENT:  CREATE TABLE "cofenster"."_Migration" ("revision" SERIAL PRIMARY KEY NOT NULL, "name" TEXT NOT NULL, "datamodel" TEXT NOT NULL, "status" TEXT NOT NULL, "applied" INTEGER NOT NULL, "rolled_back" INTEGER NOT NULL, "datamodel_steps" TEXT NOT NULL, "database_migration" TEXT NOT NULL, "errors" TEXT NOT NULL, "started_at" timestamp(3) NOT NULL, "finished_at" timestamp(3));
postgres_1         | 2020-02-14T10:18:26.725741729Z 2020-02-14 10:18:26.725 UTC [38] ERROR:  syntax error at or near ";" at character 35
postgres_1         | 2020-02-14T10:18:26.725808769Z 2020-02-14 10:18:26.725 UTC [38] STATEMENT:  ALTER TABLE "cofenster"."Project" ;

see the statement STATEMENT: ALTER TABLE "cofenster"."Project" ;

@FinnFrotscher Can you please provide a reproduction of this issue? The information that you provided is not sufficient for the identification of the bug. Maybe you can open a new issue since this one is related to MySQL.

@ifndefdeadmau5 I can indeed reproduce this with a MySQL 5.5 installation:
image

Since we don't support it, I think we can close this issue. We have opened a new issue for warning users about older database versions: https://github.com/prisma/prisma2/issues/1591

Was this page helpful?
0 / 5 - 0 ratings