-
Hello everyone, So I made a migration like that :
But I want to make "email" column unique :
That generate :
and running migration print this : I don't want to add but update column |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 6 replies
-
Try this: table.string('email').unique().alter()
or
table.string('email').alter().unique() I am not it's going to work though |
Beta Was this translation helpful? Give feedback.
-
AdonisJS uses Knex behind, take a look at Knex documentation you can use this method. If you have any email record duplicated at the database in the moment of the alter, it will not work |
Beta Was this translation helpful? Give feedback.
AdonisJS uses Knex behind, take a look at Knex documentation you can use this method.
If you have any email record duplicated at the database in the moment of the alter, it will not work