I try to rename a column in a migration:
\Schema::table('invitations', function (Blueprint $table) {
$table->renameColumn('service_id', 'project_id');
});
Running this result in an error:
Unknown database type jsonb requested, Doctrine\DBAL\Platforms\PostgreSQL92Platform may not support it.
My table as a jsonb column, I think it's the problem but I don't know why this problem occurs (because service_id is not a jsonb column).
How can I rename my column? (and why does it not work with what I wrote?)
I wrote similar migration for MySQL, IMHO, no difference with Psql.
The function renameColumn() works only with Doctrine\DBAL` and I didn't wanted to add this dependency to our project. So I did it like that
DB::transaction( function () {
DB::raw('ALTER TABLE invitations RENAME COLUMN service_id TO project_id');
});
Sorry for my English.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With