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

Improve mysqldump #23301

Merged
merged 1 commit into from Jun 17, 2016

Conversation

Projects
None yet
9 participants
@ppworks
Contributor

ppworks commented Jan 28, 2016

After we running rake db:structure:dump in project members each other, there might have diff on db/structure.sql as below.

--- MySQL dump 10.13  Distrib 5.7.9, for osx10.9 (x86_64)
+-- MySQL dump 10.13  Distrib 5.6.23, for osx10.10 (x86_64)
-) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+) ENGINE=InnoDB AUTO_INCREMENT=437 DEFAULT CHARSET=utf8;

Because default output of mysqldump includes comments like MySQL version and AUTO_INCREMENT default value and so on.

In addition, after we running rake db:migrate when we set config.active_record.schema_format=:sql in confing/application.rb, there might have different db/structure.sql as below.

--- Dump completed on 2016-01-28 13:34:00
+-- Dump completed on 2016-01-28 13:48:05

So, I added additional options to "mysqldump" command and I removed AUTO_INCREMENT default values from dumped SQL.

@rails-bot

This comment has been minimized.

Show comment
Hide comment
@rails-bot

rails-bot Jan 28, 2016

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @sgrif (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

rails-bot commented Jan 28, 2016

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @sgrif (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@pixeltrix

This comment has been minimized.

Show comment
Hide comment
@pixeltrix

pixeltrix Jan 28, 2016

Member

For reference previous discussion about this: #8004

Member

pixeltrix commented Jan 28, 2016

For reference previous discussion about this: #8004

@ppworks

This comment has been minimized.

Show comment
Hide comment
@ppworks

ppworks Jan 28, 2016

Contributor

Thanks for your reference!
I deleted ppworks@5044db4 .

Contributor

ppworks commented Jan 28, 2016

Thanks for your reference!
I deleted ppworks@5044db4 .

@ppworks

This comment has been minimized.

Show comment
Hide comment
@ppworks

ppworks Jan 28, 2016

Contributor

Thank you, I'll try to do this to avoid AUTO_INCREMENT diff.

Contributor

ppworks commented Jan 28, 2016

Thank you, I'll try to do this to avoid AUTO_INCREMENT diff.

@arthurnn

This comment has been minimized.

Show comment
Hide comment
@arthurnn
Member

arthurnn commented Mar 7, 2016

@rails-bot rails-bot assigned arthurnn and unassigned sgrif Mar 7, 2016

@metaskills

This comment has been minimized.

Show comment
Hide comment
@metaskills

metaskills May 18, 2016

Contributor

So 👀 this issue.

Contributor

metaskills commented May 18, 2016

So 👀 this issue.

@jeremy

This comment has been minimized.

Show comment
Hide comment
@jeremy

jeremy May 19, 2016

Member

Are --skip-comments and --skip-dump-date compatible with all MySQL 5.x? With MariaDB 5.x and 10.x?

Member

jeremy commented May 19, 2016

Are --skip-comments and --skip-dump-date compatible with all MySQL 5.x? With MariaDB 5.x and 10.x?

@arthurnn

This comment has been minimized.

Show comment
Hide comment
@arthurnn

arthurnn Jun 16, 2016

Member

I think if you skip-comments you dont need to skip-dump-date too. as the date is considered a comment.
At least I tested locally with skip-comment only and it worked.
Can you change to include only that?

@jeremy I see skip-comments on 5.5 https://dev.mysql.com/doc/refman/5.5/en/mysqldump.html#option_mysqldump_dump-date and maria https://mariadb.com/kb/en/mariadb/mysqldump/

Member

arthurnn commented Jun 16, 2016

I think if you skip-comments you dont need to skip-dump-date too. as the date is considered a comment.
At least I tested locally with skip-comment only and it worked.
Can you change to include only that?

@jeremy I see skip-comments on 5.5 https://dev.mysql.com/doc/refman/5.5/en/mysqldump.html#option_mysqldump_dump-date and maria https://mariadb.com/kb/en/mariadb/mysqldump/

@ppworks

This comment has been minimized.

Show comment
Hide comment
@ppworks

ppworks Jun 17, 2016

Contributor

@arthurnn Thanks for your review.

Contributor

ppworks commented Jun 17, 2016

@arthurnn Thanks for your review.

@arthurnn

This comment has been minimized.

Show comment
Hide comment
@arthurnn

arthurnn Jun 17, 2016

Member

ありがとうございます

Member

arthurnn commented Jun 17, 2016

ありがとうございます

@arthurnn arthurnn merged commit 6d4df1d into rails:master Jun 17, 2016

1 check failed

continuous-integration/travis-ci/pr The Travis CI build failed
Details
@jaredbeck

This comment has been minimized.

Show comment
Hide comment
@jaredbeck

jaredbeck Apr 7, 2017

Contributor

Am I understanding correctly that rails 5.1 will no longer include the AUTO_INCREMENT=123 comment in my structure.sql? If so, that is awesome.

Contributor

jaredbeck commented Apr 7, 2017

Am I understanding correctly that rails 5.1 will no longer include the AUTO_INCREMENT=123 comment in my structure.sql? If so, that is awesome.

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