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

Fixes #27589 - add sequence reset task #6974

Merged
merged 1 commit into from
Sep 3, 2019

Conversation

lzap
Copy link
Member

@lzap lzap commented Aug 12, 2019

For MySQL migration we need a nice way to reset sequence generators. Looks like Rails does provide this.

@theforeman-bot
Copy link
Member

Issues: #27589

@@ -0,0 +1,18 @@
# TRANSLATORS: do not translate
desc <<-END_DESC
Useful tasks for SQL sequences.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
Useful tasks for SQL sequences.
Reset PostgreSQL sequences to their max values. Does nothing on other databases.

Copy link
Member Author

Choose a reason for hiding this comment

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

Well it's explained on the second line here, this is rather generic sentence for the whole namespace but I am okay with this. Rebased.

Copy link
Member

@tbrisker tbrisker left a comment

Choose a reason for hiding this comment

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

shouldn't this just be part of the migration task? is there any case when this task should be executed separately?

@ekohl
Copy link
Member

ekohl commented Aug 15, 2019

Database restore perhaps?

@tbrisker
Copy link
Member

should it be under the db namespace tasks? i.e. db:sequence:reset or maybe db:reset_sequences? Also, lets add it to the prod2dev script so the user doesn't need to run another step manually.

@tbrisker tbrisker added this to the 1.23.0 milestone Aug 21, 2019
@lzap
Copy link
Member Author

lzap commented Aug 30, 2019

Moved it to the db namespace. Added to the wrapper task.

@lzap
Copy link
Member Author

lzap commented Sep 2, 2019

Failure unrelated, this should be ready.

lib/tasks/convert.rake Outdated Show resolved Hide resolved
@lzap lzap force-pushed the reset-sequence-27589 branch 2 times, most recently from 0a756fc to 94360c6 Compare September 3, 2019 12:49
@lzap
Copy link
Member Author

lzap commented Sep 3, 2019

Rebased.

lib/tasks/convert.rake Outdated Show resolved Hide resolved
Copy link
Member

@tbrisker tbrisker left a comment

Choose a reason for hiding this comment

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

Thanks @lzap !

@tbrisker
Copy link
Member

tbrisker commented Sep 3, 2019

Test failure unrelated.

@tbrisker tbrisker merged commit 5dd2b1b into theforeman:develop Sep 3, 2019
@tbrisker
Copy link
Member

tbrisker commented Sep 4, 2019

1.23 - 6e2ab45

@lzap lzap deleted the reset-sequence-27589 branch September 9, 2019 09:09
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.

4 participants