-
Notifications
You must be signed in to change notification settings - Fork 11.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Laravel migrate postgres comment() don't work #18782
Comments
@HaroldV steps to reproduce? |
this is in the migrate = $table->string('name',35)->nullable(false)->comment('Status Name'); |
Maybe, |
Did you find any solution? |
no marcelogarbin :( |
I have the same issue. |
I made a project with the versions that you wrote, i think is a problem with your postgres version, test with 9.4 version or later. |
@Diego0037 The command you wrote creates the column but it doesn't create the comment. Did you check if you have the comment on that column with a postgresl client?? Looking at Laravel source code I don't think it supports comments for Postgresql but I might be wrong. |
I can confirm that in Postgres 9.5.7, the following snippet creates a
|
I'm not sure how to implement this, but looking at the documentation for postgres it implements a different syntax for adding comments. As of today only MySql comments are supported for Laravel. Something along this line would be needed to get comments working in PostgresGrammar.php protected function modifyComment(Blueprint $blueprint, Fluent $column)
{
if (! is_null($column->comment)) {
return " COMMENT ON COLUMN ". getColumnNameMethod()." '".addslashes($column->comment)."';"
}
} I have not tested this as I am quite new with laravel. Just to be clear, there is no Any ideas if this may work? |
I believe this issue can be closed; the references PR implements this for postgres. |
Description:
Do not work function comment in the migration with postgresql
Steps To Reproduce:
this is in the migrate = $table->string('name',35)->nullable(false)->comment('Status Name');
I execute migrate and nothing
The text was updated successfully, but these errors were encountered: