fluent-kit
fluent-kit copied to clipboard
Delete field constraint
Hello,
I have model in my application where one of the fields is notNull. I Would like to write manual migration where I delete this constraint, but I can't find any builder method that allows me to do so.
I found only schemaConstraintDelete method on builder, but I'm not sure if I can use it to delete field constraint.
Is there any way to delete notNull, default or other SQLColumnConstraint from my model table?
This would require an ALTER COLUMN query which I don't believe Fluent supports at the moment. In the meantime, you should be able to do this query with SQL manually using conn.raw("...") in the migration.
So looks like FluentKit can now alter columns to change column types by using the updateField API, but there's still no way to delete a field constraint, it seems like you can only add them. This would be a great addition!