Hello prisma team, Hope everyone is doing great. ...
# prisma-migrate
n
Hello prisma team, Hope everyone is doing great. I have a question with respect to prisma migrate. So right now current state of schema.prisma file is this
Copy code
enum Position {
  First
  Second
  Last
}

model Test {
  id        String     @id @default(uuid())
  name      String     @unique
  positions Position[]

  // common fields
  createdAt DateTime @default(now()) @map("created_at")
  updatedAt DateTime @default(now()) @updatedAt @map("updated_at")

  @@map("test")
}
Now I am removing one value (Last) from enum 
Position
. So after removing I ran this command:
prisma generate --schema=./schema.prisma && prisma migrate dev --schema=./schema.prisma
Above command created a new migration file like this
Copy code
/*
  Warnings:

  - The values [Last] on the enum `Position` will be removed. If these variants are still used in the database, this will fail.

*/
-- AlterEnum
BEGIN;
CREATE TYPE "Position_new" AS ENUM ('First', 'Second');
ALTER TABLE "test" ALTER COLUMN "positions" TYPE "Position_new" USING ("positions"::text::"Position_new");
ALTER TYPE "Position" RENAME TO "Position_old";
ALTER TYPE "Position_new" RENAME TO "Position";
DROP TYPE "Position_old";
COMMIT;
Now if I rerun 
prisma migrate dev --schema=./schema.prisma
 , it should not do any change, because I haven't changed any thing and all the migrations should be completed with above migration file. But it is again asking for a new migration name and when I entered some name for migration it errors by this. Also it created one more migration file
Copy code
/*
  Warnings:

  - Changed the column `positions` on the `test` table from a scalar field to a list field. If there are non-null values in that column, this step will fail.

*/
-- AlterTable
ALTER TABLE "test" ALTER COLUMN "positions" SET DATA TYPE "Position"[];
Here I couldn't understand why it is again asking for a new migration and even though we are giving it name it is throwing error. Prisma version - 2.26.0
j
That does seem weird indeed and like a bug - please create an issue in our repository.
n
Sure creating an issue for this.
👍 1
Created an issue for this.
j
Thanks. Added a few labels and someone will look at it asap.
🙌 1