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

MySQL/MariaDB add extra info for date/timestamp columns for the diffChangeLog #5126

Closed
2 tasks done
LonwoLonwo opened this issue Oct 26, 2023 · 1 comment
Closed
2 tasks done

Comments

@LonwoLonwo
Copy link
Contributor

Search first

  • I searched and no similar issues were found

Description

The previous ticket is here #3430

Now, it is better but works only for MySQL.

Because MariaDB returns in the EXTRA column for information_schema.COLUMNS not the expected by code value like

DEFAULT_GENERATED on update CURRENT_TIMESTAMP

but this value instead:

on update current_timestamp()

2023-10-26 14_50_41-DBeaver Ultimate 23 2 3 - MariaDB 10 6 Script-99

2023-10-26 14_55_56-DBeaver Ultimate 23 2 3 - Google Cloud SQL - MySQL - test-mysql-instance Scrip

This is just version databases specific. And documentation says that the second option is expected: https://dev.mysql.com/doc/refman/8.2/en/show-columns.html

Steps To Reproduce

Create table

CREATE TABLE t1 (
  ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  dt DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

In the MariaDB database. Then try to use diffChangeLog to any empty schema.

Result will have this query:

CREATE TABLE t1 (
  ts timestamp DEFAULT NOW() NULL, 
  dt datetime DEFAULT NOW() NULL
);

Expected/Desired Behavior

Expected query like the original one:

CREATE TABLE t1 (
  ts TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
  dt DATETIME DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP
);

Liquibase Version

liquibase-core-4.24.0

Database Vendor & Version

MariaDB 10.6

Liquibase Integration

No response

Liquibase Extensions

No response

OS and/or Infrastructure Type/Provider

No response

Additional Context

No response

Are you willing to submit a PR?

  • I'm willing to submit a PR (Thank you!)
@LonwoLonwo
Copy link
Contributor Author

If I understood correctly, my PR is in the devel. So. I'm closing the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Done
Development

No branches or pull requests

3 participants