You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@tomhoule , I provided information in the other tickets, but the core issue is that the current syntax used to change the default on pre-existing datetime fields to add current_timestamp is invalid. This is a hard blocker for any project migrating via introspect and needing to add support for functions like createdAt. At the moment, I'm fully stalled on a project until the syntax is corrected. Notes here: prisma/migrate#429 (comment)
@radicand I'm stuck just like you. Have you found a workaround?
It's not ideal at all, but when I need to execute a migration I truncate the Migrations table, delete all previous migration files, create a new 'initial' migration, and then manually edit steps.json to remove all the blocks associated with setting the default now() column (two blocks in the file per column affected). Running the migration after should succeed, but you have to repeat all these steps every time you have a new change.
This is something we are planning to address very soon. The reason it takes time is because SET DEFAULT CURRENT_TIMESTAMP doesn't work on most mysql versions, so we have to change our approach to migrating defaults to use MODIFY, which isn't trivial as we need to know the exact column definition to repeat it with a different default.
Related:
The text was updated successfully, but these errors were encountered: