Migrate: All DateTime values cleared each migration

Created on 16 Dec 2019  路  5Comments  路  Source: prisma/migrate

Here is an example of the warning message:

You are about to alter the column createdAt on the Command table, which still contains 1 non-null values. The data in that column will be lost.

Running the SQL in the migration README directly works as intended, so it must have something to do with the lift up internal logic.

image

Prisma version: 2.0.0-preview018.2

Slack conversation where other users mention they've experienced this as well.
https://prisma.slack.com/archives/CKQTGR6T0/p1576176946343300

Not sure if this is related, but I'm connecting remotely to a Heroku Postgres Instance. I'm using the sslmode=require query param on my connection URI.

This is with a schema that is essentially the example Javascript "Script" example.

Most helpful comment

I had the exactly the same issue, every time I run lift up I get those messages for createdAt, updatedAt fields even though they already have been migrated.

All 5 comments

I had the exactly the same issue, every time I run lift up I get those messages for createdAt, updatedAt fields even though they already have been migrated.

I've checked the README.md inside the migrations folder when migration is generated. So basically the problem is this:

"createdAt" timestamp(3) NOT NULL DEFAULT '1970-01-01 00:00:00' ,
"updatedAt" timestamp(3) NOT NULL DEFAULT '1970-01-01 00:00:00' ,

And the same goes for each DateTime type:

  "pickupDateFrom" timestamp(3) NOT NULL DEFAULT '1970-01-01 00:00:00' ,
  "pickupDateThru" timestamp(3) NOT NULL DEFAULT '1970-01-01 00:00:00' ,

So I guess this is the problem with DateTime itself.

This should be fixed by https://github.com/prisma/prisma-engine/pull/318 :) It will be in the next alpha release.

@tomhoule Just checked the latest alpha release the issue still remains the same.

@impowski Please follow https://github.com/prisma/migrate/issues/291 now

Was this page helpful?
0 / 5 - 0 ratings

Related issues

julien1619 picture julien1619  路  4Comments

chanphiromsok picture chanphiromsok  路  3Comments

hamidb80 picture hamidb80  路  4Comments

sameoldmadness picture sameoldmadness  路  4Comments

MichalLytek picture MichalLytek  路  3Comments