OsakaWebbie
OsakaWebbie

Reputation: 699

Clean mysqldump for tracking schema in git

I want to write a set of small shell scripts to help me keep MySQL schema in git. But one crux is that mysqldump -uuser -ppass -d devdb > schema.sql includes two things that change over time even if there are no schema changes:

I have scoured the web for ways to get a dump without those things, to no avail. Can you advise? Or should I be using a different command or tool to get a clean schema for use in version control?

EDIT: I just now found the --skip-dump-date option, so that solves point #2, but I still can't get rid of the auto-increment number without losing the other table attributes (or whatever you call those things) like the engine and the default character set.

Upvotes: 1

Views: 168

Answers (1)

Guriandoro
Guriandoro

Reputation: 141

There is no way to bypass #1, check https://bugs.mysql.com/bug.php?id=20786.

As noted in the comments section, you can use that sed command to filter it out (unless you have some CREATE TABLE statements that use it).

Upvotes: 2

Related Questions