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

Fixed autoIncrement incrementBy/startWith support in MySQL, H2, HSQLDB, and MariaDB #3026

Merged
merged 5 commits into from Jul 20, 2022

Conversation

tozogabee
Copy link

@tozogabee tozogabee commented Jun 30, 2022

Impact

  • Bug fix (non-breaking change which fixes expected existing functionality)
  • Enhancement/New feature (adds functionality without impacting existing logic)
  • Breaking change (fix or feature that would cause existing functionality to change)

Description

Mysql / MariaDB

Neither support specifying incrementBy, so that is now a validation error.

H2 / Hsql

In both databases, incrementBy and startWith were ignored in both createTable and addAutoIncrement changes. Both those should now be supported.

Things to be aware of

  • Only impacts the given databases
  • Should test that both createTable and addAutoIncrement work with with none, one, or both of incrementBy and startWith specified in both createTable and addAutoIncrement
  • Should test for incrementBy not allowed in both createTable and addAutoIncrement

Things to worry about

  • Nothing

@tozogabee tozogabee requested a review from nvoxland June 30, 2022 15:29
@tozogabee tozogabee self-assigned this Jun 30, 2022
@github-actions
Copy link

github-actions bot commented Jun 30, 2022

Unit Test Results

  4 608 files  ±0    4 608 suites  ±0   34m 51s ⏱️ + 5m 18s
  4 578 tests ±0    4 360 ✔️ ±0     218 💤 ±0  0 ±0 
54 108 runs  ±0  49 096 ✔️ ±0  5 012 💤 ±0  0 ±0 

Results for commit ee29021. ± Comparison against base commit 4fb56c5.

♻️ This comment has been updated with latest results.

@kataggart
Copy link
Contributor

@nvoxland Can you update the PR name to better describe the fix in context of automating release notes when you review this one please? Thanks!

@kataggart kataggart added this to To Do in Conditioning++ via automation Jun 30, 2022
@nvoxland nvoxland changed the title 2863: autoIncrement issue fixed: MySQL,H2,HSQLDB,MariaDB. Fixed autoIncrement incrementBy/startWith support in MySQL, H2, HSQLDB, and MariaDB Jul 7, 2022
Copy link
Contributor

@XDelphiGrl XDelphiGrl left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • Changes improve handling of incrementBy and startWith attributes.
  • New unit tests added.
  • No additional testing required.

APPROVED

Passing Functional Tests
Passing Test Harness Execution

@nvoxland nvoxland merged commit 9b4f534 into master Jul 20, 2022
Conditioning++ automation moved this from To Do to Done Jul 20, 2022
@nvoxland nvoxland deleted the 2863 branch July 20, 2022 14:39
@th3lon3w0lf
Copy link

th3lon3w0lf commented Dec 21, 2022

This change is breaking our liquibase version upgrade. I have a MySQL DB on which we had the incrementBy attribute in the changeset. Since this is a validation error now, removed the incrementBy attribute from changeset and now, liquibase fails with modified checksum error(Because the md5 is different in databasechangelog for this changeset prior to the removal). If I enable "runOnChange=true", that fails because the table already exists.

Ideally, I would expect the incrementBy attribute removal shouldn't cause a checksum difference error if the validation error is introduced for this.

Am I missing something? How to get past this error?

@pkoulerimarshmallow
Copy link

pkoulerimarshmallow commented Sep 11, 2023

@th3lon3w0lf it's been a while since your post, but what seems to work is:

  • Remove addAutoIncrement from your changeSet.
  • Add validCheckSum: <the already applied checksum in your DATABASECHANGELOG to your changeSet.
  • If needed use autoIncrement: true to the column you need auto-incremented.

For example:

              - column:
                  name: count
                  type: int
                  autoIncrement: true
                  constraints:
                    unique: true
                    nullable: false

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

Successfully merging this pull request may close these issues.

addAutoIncrement isn't working properly for HyperSQL, Mysql, MariaDB and H2
7 participants