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

BUGFIX: Fix H2 auto increment syntax #2477

Closed
wants to merge 1 commit into from

Conversation

drivera-armedia
Copy link

H2 has updated such that the old auto increment syntax no longer works

Environment

Liquibase Version: 4.7.1

Liquibase Integration & Version: Java embedded

Liquibase Extension(s) & Version: no extensions

Database Vendor & Version: H2 2.1.210

Operating System Type & Version: Ubuntu Linux 21.04

Pull Request Type

  • Bug fix (non-breaking change which fixes an issue.)
  • Enhancement/New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

H2 has modified its syntax to no longer support AUTO_INCREMENT unless being used in MySQL mode. In other modes, it's been advised that the standard GENERATED AS IDENTITY syntax. Furthermore, it doesn't support the exact syntax so the comma used between the START WITH and INCREMENT BY clauses needed to be (configurably) removed, so I added a means to do just that which only takes effect for H2Database.

Steps To Reproduce

List the steps to reproduce the behavior.

  • Create a changeset which includes an autoIncrement column
  • Apply said changeset to an H2 database in PostgreSQL mode

Actual Behavior

  • Changeset will fail with unrecognized syntax on AUTO_INCREMENT

Expected/Desired Behavior

  • Changeset will succeed and properly render tables with/modify existing auto-increment columns

Fast Track PR Acceptance Checklist:

H2 has updated such that the old auto increment syntax no longer works
@nvoxland
Copy link
Contributor

This is a duplicate of #2372

@nvoxland nvoxland closed this Feb 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants