Heya, this is mostly a continuation/resurfacing of #100
When doing a simple migration, like adding an optional string filed to a model, lift warns about pretty much every column under the sun being dropped.
The interesting part is, this time, the steps that would lead to such data loss aren't actually a part of the steps.json or readme steps.
model User {
id String @default(cuid()) @id
name String
posts Post
email String
}
model Post {
id String @default(cuid()) @id
title String?
author User
content String?
published Boolean @default(false)
}
Add a new field to one of the models:
testField String?
Try saving the migration.
❯ prisma2 lift save --name add-field
📼 lift save --name add-field
Local datamodel Changes:
model User {
id String @default(cuid()) @id
name String
posts Post
email String
testField String?
}
⚠️ There might be data loss when applying the migration:
• You are about to alter the column `email` on the `User` table, which still contains 1 non-null values. The data in that column will be lost.
• You are about to alter the column `name` on the `User` table, which still contains 1 non-null values. The data in that column will be lost.
• You are about to alter the column `content` on the `Post` table, which still contains 1 non-null values. The data in that column will be lost.
• You are about to alter the column `title` on the `Post` table, which still contains 1 non-null values. The data in that column will be lost.
Lift just created your migration 20200115071932-add-field in
migrations/
└─ 20200115071932-add-field/
└─ steps.json
└─ schema.prisma
└─ README.md
Run prisma2 lift up to apply the migration
EDIT: Just confirmed there is actual dataloss
Experiencing the same issue. None of the below model fields were modified prior to the attempted migration. This is very debilitating:

Copying my reply to #267 here:
I am fairly confident this issue was fixed a few weeks ago (prisma/prisma-engine#326 and others), but we haven't released a preview version since. Please try again with the latest prisma2@alpha or wait for the next preview release, which should be very soon now.
edit: I tried with the latest alpha and I can't reproduce the problem.
Most helpful comment
Copying my reply to #267 here:
I am fairly confident this issue was fixed a few weeks ago (prisma/prisma-engine#326 and others), but we haven't released a preview version since. Please try again with the latest prisma2@alpha or wait for the next preview release, which should be very soon now.
edit: I tried with the latest alpha and I can't reproduce the problem.