propelorm / Propel2

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

Suggestion/discussion: Mysql-MariaDB Flavor #1781

Open jeremydenoun opened 3 years ago

jeremydenoun commented 3 years ago

Hi,

I am happy to see that the project is coming back to life, in particular because I have launched a project where I'd like update my stack and especially projects where I use Propel2.

During my updates, I must consider switch to other mysql flavor previously I use Oracle MySQL 5.6/5.7, in past I switch to Percona 5.7/8.0 without any issue (there target is to follow at maximum MySQL behavior so this is often painless) but I try to switch to MariaDB and I see they are more SQL dialect respectful but can differ than MySQL about some return.

This impact directly propel in "Database Diff Computing" because Column Reverse can differ (and potentially make loop).

I'd like your opinion about the right way to handle flavor in Reverse/Platform/Compare workflow, an example if you define a timestamp column with defaultExpr look like CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP, mysql/percona reverse will look like CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP (so match) but MariaDB return CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP() (so doesn't match)

What is the most elegant fix to support multiple (especially in behavior) ?

From my side I made branch to match my flavor, but I think a way to handle this properly (and maybe for all kind of use case can happened) can have benefit for all

Thanks for your reply