propelorm / Propel2

Propel2 is an open-source high-performance Object-Relational Mapping (ORM) for modern PHP
http://propelorm.org/
MIT License
1.26k stars 393 forks source link

Support ON UPDATE CURRENT_TIMESTAMP in MySQL #1967

Closed Mau04 closed 7 months ago

Mau04 commented 1 year ago

This PR adds support for defaultExpr="CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP" for MySQL as requested in #1203. Previously, a migration would always contain an ALTER Statement to set ON UPDATE CURRENT_TIMESTAMP although it is already like that in the database. The root cause was that the Extra part was not checked in the MysqlSchemaParser class.

codecov-commenter commented 1 year ago

Codecov Report

All modified lines are covered by tests :white_check_mark:

Comparison is base (4f36eea) 89.27% compared to head (9ddf3c9) 89.27%.

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #1967 +/- ## ========================================= Coverage 89.27% 89.27% - Complexity 8049 8053 +4 ========================================= Files 232 232 Lines 24519 24526 +7 ========================================= + Hits 21889 21896 +7 Misses 2630 2630 ``` | [Flag](https://app.codecov.io/gh/propelorm/Propel2/pull/1967/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=propelorm) | Coverage Δ | | |---|---|---| | [5-max](https://app.codecov.io/gh/propelorm/Propel2/pull/1967/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=propelorm) | `89.27% <100.00%> (+<0.01%)` | :arrow_up: | | [7.4](https://app.codecov.io/gh/propelorm/Propel2/pull/1967/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=propelorm) | `89.27% <100.00%> (+<0.01%)` | :arrow_up: | | [agnostic](https://app.codecov.io/gh/propelorm/Propel2/pull/1967/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=propelorm) | `67.46% <50.00%> (-0.01%)` | :arrow_down: | | [mysql](https://app.codecov.io/gh/propelorm/Propel2/pull/1967/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=propelorm) | `69.79% <37.50%> (-0.02%)` | :arrow_down: | | [pgsql](https://app.codecov.io/gh/propelorm/Propel2/pull/1967/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=propelorm) | `69.83% <75.00%> (+<0.01%)` | :arrow_up: | | [sqlite](https://app.codecov.io/gh/propelorm/Propel2/pull/1967/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=propelorm) | `67.78% <12.50%> (-0.02%)` | :arrow_down: | Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=propelorm#carryforward-flags-in-the-pull-request-comment) to find out more. | [Files](https://app.codecov.io/gh/propelorm/Propel2/pull/1967?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=propelorm) | Coverage Δ | | |---|---|---| | [src/Propel/Generator/Platform/PgsqlPlatform.php](https://app.codecov.io/gh/propelorm/Propel2/pull/1967?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=propelorm#diff-c3JjL1Byb3BlbC9HZW5lcmF0b3IvUGxhdGZvcm0vUGdzcWxQbGF0Zm9ybS5waHA=) | `97.84% <100.00%> (+0.02%)` | :arrow_up: | | [src/Propel/Generator/Platform/SqlitePlatform.php](https://app.codecov.io/gh/propelorm/Propel2/pull/1967?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=propelorm#diff-c3JjL1Byb3BlbC9HZW5lcmF0b3IvUGxhdGZvcm0vU3FsaXRlUGxhdGZvcm0ucGhw) | `92.96% <100.00%> (ø)` | | | [src/Propel/Generator/Reverse/MysqlSchemaParser.php](https://app.codecov.io/gh/propelorm/Propel2/pull/1967?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=propelorm#diff-c3JjL1Byb3BlbC9HZW5lcmF0b3IvUmV2ZXJzZS9NeXNxbFNjaGVtYVBhcnNlci5waHA=) | `88.84% <100.00%> (+0.09%)` | :arrow_up: |

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

mringler commented 10 months ago

@Mau04 It looks like the old maintainer of Propel2, @dereuromark, has left the project, and it looks like there is no successor at Spryker at the moment. I have contacted the owner, and he told me that the project will keep being maintained by Spryker, but I haven't heard back if/when there will be someone who actively maintains Propel2, i.e. merges this PRs. For what it's worth, I am very sorry for the situation! This should have been merged month ago, with all the thanks and commendations that are in order. I found getting acquainted with Propel and creating a PR takes effort, and I wish your first contribution to the project had been a more rewarding experience. I guess when/if someone takes over, contributors like you and I can decide if they want to come back. Best wishes

a-sabaa commented 10 months ago

Hello @mringler & @Mau04 Community contributions are the backbone of Propel, and Spryker aims to play a supportive role in enhancing this ecosystem. We're actively looking for core contributors while improving our own support levels. Expect quicker, more impactful responses to PRs and contributions going forward, as we are ramping up the developer effort on the open PRs in the repository.

Thank you for your vital role in this community. We're excited for more collaborative achievements