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

sql/mysql: support for auto_increment attribute #570

Merged
merged 3 commits into from
Feb 12, 2022
Merged

sql/mysql: support for auto_increment attribute #570

merged 3 commits into from
Feb 12, 2022

Conversation

a8m
Copy link
Member

@a8m a8m commented Feb 12, 2022

MySQL support for #517. PostgreSQL and SQLite will be added in future PRs.

Comment on lines 232 to 240
// Ignore if the AUTO_INCREMENT attribute was dropped from the desired schema.
case fromHas && !toHas:
// The AUTO_INCREMENT exists in the desired schema, and may not exists in the inspected one.
// This can happen because older versions of MySQL (< 8.0) stored the AUTO_INCREMENT counter
// in main memory (not persistent), and the value is reset on process restart for empty tables.
case toHas && fromA.V < toA.V:
// Suggest a diff only if the desired value is greater than the inspected one,
// because this attribute cannot be maintained in users schema and used to set
// up only the initial value.
Copy link
Member Author

Choose a reason for hiding this comment

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

Verbose comments, but prefer to keep them for future maintainers as this info exists only in my head atm.

Copy link
Member

@rotemtam rotemtam left a comment

Choose a reason for hiding this comment

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

💯

Also, fix minor diff issue in AUTO_INCREMENT migration
@a8m a8m merged commit dd2996c into master Feb 12, 2022
@a8m a8m deleted the autoinc branch February 12, 2022 22:33
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

Successfully merging this pull request may close these issues.

2 participants