Skip to content
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

CURRENT_TIMESTAMP detection mistake #4

Closed
BCsabaEngine opened this issue Jun 15, 2020 · 3 comments
Closed

CURRENT_TIMESTAMP detection mistake #4

BCsabaEngine opened this issue Jun 15, 2020 · 3 comments

Comments

@BCsabaEngine
Copy link

Used 10.3.22-MariaDB-0+deb10u1 (RaspberryPI) the DateTime field with CURRENT_TIMESTAMP modified in every run.
Reason: detected UpdatableTimeColumnDefinition._default = "current_timestamp()", but the target column definition is "CURRENT_TIMESTAMP". So it is a mysql/mariadb dialect difference. It may be NOW() in previous mysql (5.x?) versions.

TableDefinitions.js#line134: the comparer function should be smarter to handle dialect differences.

@nwoltman
Copy link
Owner

Hi @SymbolCsaba. I just wanted to acknowledge that I understand the issue and I think I know how it could be fixed, but I haven't found the time to work on the fix yet. I hope to be able to work on this sometime within the next few days.

nwoltman added a commit that referenced this issue Jun 28, 2020
Handle MariaDB using a different format for `DEFAULT CURRENT_TIMESTAMP` and `ON UPDATE CURRENT_TIMESTAMP` (MariaDB uses `current_timestamp()`) by translating `current_timestamp()` to `CURRENT_TIMESTAMP` when parsing the SQL into a schema object.

Fixes #4
@nwoltman
Copy link
Owner

This should be fixed in v0.16.2

@BCsabaEngine
Copy link
Author

Works great, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants