Notice I altered table name from demo_user -> user to simulate table level conflict, similarly I altered password -> password_hash to simulate column level conflict.
Now run the generate command again:
drizzle-kit generate
drizzle-kit prompts to choose if user is new table or renamed from demo_user.
Check the migration file 0002_stormy_dreadnoughts.sql in my case:
ALTER TABLE "demo_user" RENAME TO "user";
Expected behavior
drizzle-kit should've prompted to resolve column conflicts (if password_hash renamed from password)
Generated migration file should've included
ALTER TABLE "user" RENAME COLUMN "password" TO "password_hash";
Environment & setup
This issue only occurs if we have table conflict as well. I have tested while only simulating column conflict and it worked as expected. I've been using drizzle-kit@^0.20.0 and this issue wasn't there. I observed this issue after updating to drizzle-kit@^0.21.2
What version of
drizzle-orm
are you using?0.21.2
What version of
drizzle-kit
are you using?0.30.6
Describe the Bug
Simulate the column conflicts:
demo_table
:0001_opposite_thena.sql
in my case):Notice I altered table name from
demo_user
->user
to simulate table level conflict, similarly I alteredpassword
->password_hash
to simulate column level conflict.drizzle-kit prompts to choose if
user
is new table or renamed fromdemo_user
.0002_stormy_dreadnoughts.sql
in my case:Expected behavior
password_hash
renamed frompassword
)Environment & setup
This issue only occurs if we have table conflict as well. I have tested while only simulating column conflict and it worked as expected. I've been using
drizzle-kit@^0.20.0
and this issue wasn't there. I observed this issue after updating todrizzle-kit@^0.21.2