Skip to content
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

Managing non-ColumnSchemaBuilder provided columns and special DBMS altering cases #52

Closed
bizley opened this issue Apr 10, 2019 · 1 comment
Assignees
Labels

Comments

@bizley
Copy link
Owner

bizley commented Apr 10, 2019

  1. Yii 2 migrations encourage to use shortcut methods from SchemaBuilderTrait but it's still possible to use plain text descriptions that were in use before Yii 2.0.6. Question is if that should be handled as well by this extension because right now is not. I need to investigate.

  2. Apparently PostgreSQL column altering way is different from other DBMS and for example requires special statement to change default value or doesn't allow changing column type and default value at once (in single ALTER COLUMN statement). Am I right here?
    Yii detects special statements and only decodes column type if there are none. This extension definitely needs to do the same.

  3. There is related to above problem bug issued in Yii - when altering column using new column definition with more than a type like:

     $this->alterColumn('table', 'column', $this->string()->defaultValue(1));
    

    PostgreSQL throws error. It would be nice for generated statement to be correct in that case. I'll take a look at this as well.

@bizley
Copy link
Owner Author

bizley commented Apr 25, 2019

I've decided that migrations using column data that is not instance of ColumnSchemaBuilder will not be handled by this extension (as these never were anyway) but from now on extracting such migrations exception will be thrown.

As for (2) and (3) - I've added PR for the bug mentioned here so hopefully it will be fixed in Yii 2.0.19.

@bizley bizley closed this as completed Apr 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant