I have some dictionary table in my DB schema. E.g. "EventType" whth fields "id" and "value".
This table have one row:
1 TypeOne
Can I create a prisma migration with sql?
INSERT INTO "EventType" (id, value) VALUES (2, 'TypeTwo')
All the prisma migration files are valid SQL so you can put any arbitrary SQL in your migration files and it will be added to your migration history.
This is what you have to do:
--create-only flag.npx prisma migrate dev --create-only
Take a look at the generated migration.sql file and update it accordingly to add any new SQL statements.
Apply the migrations npx prisma migrate dev
Important Note: Always make sure you apply the changes to migration.sql before applying it to your database. Modifying an already applied migration file will lead to a corrupt migration history.