[go: up one dir, main page]

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

Support dataType in createSequence for more DBMS #6421

Open
1 of 2 tasks
Alienmario opened this issue Oct 14, 2024 · 4 comments · May be fixed by #6523
Open
1 of 2 tasks

Support dataType in createSequence for more DBMS #6421

Alienmario opened this issue Oct 14, 2024 · 4 comments · May be fixed by #6523
Labels

Comments

@Alienmario
Copy link
Alienmario commented Oct 14, 2024

Search first

  • I searched and no similar issues were found

Description

It seems that a "data type" parameter for sequence creation is available more broadly than liquibase currently supports.

I have checked HSQLDB and MSSQL, both appear to support it.

Related to #3328, which added such support for DB2LUW.

Steps To Reproduce

Run on HSQLDB or MSSQL

<createSequence sequenceName="MY_SEQUENCE" dataType="BIGINT" startValue="1" incrementBy="1"/>

Expected/Desired Behavior

No validation failures

Liquibase Version

4.28.0

Database Vendor & Version

hsqldb 2.7.2

Liquibase Integration

maven

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!)
@lbadam
Copy link
lbadam commented Oct 14, 2024

@Alienmario thanks for filing this issue. To clarify, are you suggesting that we need to update the dataType documentation here to add additional supported DBs?

Image

@Alienmario
Copy link
Author

No, I am asking to implement/allow specifying dataType for additional databases, similiar to mentioned PR.

@lbadam
Copy link
lbadam commented Oct 21, 2024

@Alienmario ok. If a DB has support for dataType it should automatically work unless it's in this list. That list does include HSQLDB and MSSQL so we can start by rechecking those and removing them from the list.

Are you open to submitting a PR for those changes?

@lbadam lbadam added the TypeBug label Oct 21, 2024
@Alienmario
Copy link
Author

@lbadam Sure, I can have a try at it.

Browsing the CreateSequenceGenerator code, i'm noticing additional discrepancies between databases:

  • The "IF NOT EXISTS" keyword automatically appended in Postgres is also available at least in HSQLDB. Would it be desirable to have it added?
  • For databases HsqlDatabase and Db2zDatabase "AS BIGINT" is currently forced, ignoring the specified datatype. I'm assuming this is because these databases default to INTEGER data type, if not specified. However, since both support specifying dataType, I would like to change this behavior to only run when no dataType is specified in liquibase.
  • I would also add "normal" DB2Database to the above as it also defaults to INTEGER for sequences. 1, 2
  • The "cacheSize" parameter support does not correspond with documentation. However, that can be handled in another issue.

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

Successfully merging a pull request may close this issue.

2 participants