headsnet / domain-events-bundle

DDD Domain events for Symfony
MIT License
39 stars 4 forks source link

DateTimeImmutableMicrosecondsType does not work for MariaDBPlatform #28

Closed wazum closed 2 years ago

wazum commented 2 years ago

MariaDBPlatform extends MySQLPlatform and not MySQL57Platform which is used in DateTimeImmutableMicrosecondsType

class MariaDBPlatform extends MySQLPlatform
benr77 commented 2 years ago

I'm not aware of any reason why we shouldn't just check against MySQLPlatform instead of MySQL57Platform - are you?

MySQL 5.7 already supports microseconds fragments: https://dev.mysql.com/doc/refman/5.7/en/fractional-seconds.html

wazum commented 2 years ago

MySQLPlatform does theoretically support MySQL down to version 5.0 as far as I read online, which imho has no support for fractional seconds (that came with 5.7?). But I'm not aware of anyone using such old versions :-D

benr77 commented 2 years ago

Would using a precision of 6 via a DATETIME(6) column break on MySQL 5.0 or just be silently ignored? I don't have an install I can test on very easily.

I'm not sure we should even care, as MySQL 5.5 support ended December 2018 and 5.6 in February 2021. The minimum supported Symfony version of the bundle is 4.4, so I guess it will not be used by any particularly old applications.

So unless you have anything else to add I'd suggest we go for it and replace MySQL57Platform with MySQLPlatform.

wazum commented 2 years ago

No, go ahead! Thanks

benr77 commented 2 years ago

Ok done and tagged new release v0.1.9