fluent-kit
fluent-kit copied to clipboard
Add rename functionality to schema builder
Currently, we have to use raw queries in order to rename columns.
sqlDB.raw("ALTER TABLE table RENAME COLUMN col1 TO col2")
I also tried using the new raw SQL helpers for Fluent, but the issue is something like .updateField(.sql(raw:)) appends ALTER COLUMN, so it would not work (for Postgres) at least.
It would be nice to have a solution built into schema builder, that allowed something like:
schemaBuilder.rename("col1", to: "col2")
or just another raw SQL helper to add a complete raw expression to the schema builder.