-
Notifications
You must be signed in to change notification settings - Fork 891
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
Using Literal for creating virtual columns throws error on MariaDB #2157
Comments
Feel free to make a PR here with suggested changes |
#2158 PR for the issue |
PR open for discussion, please add the explanations there in the opening comment. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
When using Literal class to create a virtual column in MariaDB like so:
it throws MySQL error
as
NOT NULL
is not allowed after creation of virtual column.NOT NULL
is by default added onphinx/src/Phinx/Db/Adapter/MysqlAdapter.php
Line 1365 in 343645c
Virtual column is set as
NULL
in MariaDB as default and cannot be changed so also if create statement is rewritten to:note
['null' => true]
as the option, it returns an error ofI suggest rewriting:
phinx/src/Phinx/Db/Adapter/MysqlAdapter.php
Line 1365 in 343645c
to:
Tested on MariaDB and MySQL and works as expected.
Any thoughts?
Regards, Oskar
The text was updated successfully, but these errors were encountered: