-
Notifications
You must be signed in to change notification settings - Fork 46
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
on update current_timestamp() seems to be lost in migration #115
Comments
Can you show the generated migration class? |
Sure!
|
It looks like a bug in the class See here: phinx-migrations-generator/src/Migration/Adapter/Generator/PhinxMySqlColumnOptionGenerator.php Line 193 in 33dfa04
The Demo: https://3v4l.org/XXUg6 Can you create a PR? |
Well done finding this bug! I've made a PR making the statement case-insensitive. |
Hi Daniel
I created a table with the column
updated_at
which should hold thecurrent_timestamp()
value when the row is updated.When running
phinx-migrations generate --overwrite -c config/env/env.phinx.php --ansi
and look at the generatedschema.php
I see the following:So it has been picked up by the generation with the "EXTRA" key but if I now delete the user table in the database and the phinx log table and run
composer migrate
orvendor/bin/phinx migrate -c config/env/env.phinx.php --ansi -vvv
the table is generated without the ON UPDATE value, it's just blank.Is that a phinx bug or is something wrong with the generated
schema.php
?Thanks for looking into this!
Edit:
I'm using the latest version 6.1.0.
DDL before
phinx-migrations generate
Migration creation log in the console when running the phinx migrate command after deleting the user and phinx log table
DDL after :
The text was updated successfully, but these errors were encountered: