So today I wanted to add an unique
constraint to my ArticleCategory
table, but it doesn’t work, my code:
1 | struct ModifyNameToCategory: Migration { |
The error:
1 | [ INFO ] query read _fluent_migrations |
By reading the source code, I found this because the fluent-kit
didn’t add handling for the update
action to add constraint. But it does have handing for create
action to add constraint. Please see the issue detail I submitted.
So what we can do now? Luckly, we can use the old way:
1 | import Foundation |
Don’t forget to import FluentSQL
and FluentPostgresDriver