We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Create MySQL >= 5.6.4 table with timestamp(3) column and CURRENT_TIMESTAMP(3) as default value. Fetch this schema in Yii 2.
timestamp(3)
CURRENT_TIMESTAMP(3)
$column->defaultValue = new Expression('CURRENT_TIMESTAMP(3)');
$column->defaultValue = 'CURRENT_TIMESTAMP(3)';
These lines are too strict now. I'll prepare PR with regex match and see if it's enough.
The text was updated successfully, but these errors were encountered:
Quick and easy would be to use stripos and check if it matches 0.
stripos
if (($column->type === 'timestamp' || $column->type === 'datetime') && stripos($info['default'], 'current_timestamp') === 0) { $column->defaultValue = new Expression('CURRENT_TIMESTAMP'); } elseif (isset($type) && $type === 'bit') {
Sorry, something went wrong.
Yes, if this is enough and matches all possibilities. I haven't dig into MySQL and MariaDB docs yet ;)
b79fe7d
No branches or pull requests
What steps will reproduce the problem?
Create MySQL >= 5.6.4 table with
timestamp(3)
column andCURRENT_TIMESTAMP(3)
as default value.Fetch this schema in Yii 2.
What is the expected result?
What do you get instead?
Additional info
These lines are too strict now. I'll prepare PR with regex match and see if it's enough.
The text was updated successfully, but these errors were encountered: