I ran migrations on my sandbox environment, and then on my production
environment, and I’m getting slight differences. I’m fairly new to
MySQL.
The differences are these AUTO_INCREMENT fields. Should I take the
difference to indicate that I’ve messed up my migrations and should
start
fresh? Or is it possible for the same migrations to result in different
schemas?
I have seen this behavior when a dump is made from a database that
already contains data. The auto-increment attribute is only reset by
calling TRUNCATE TABLE tablename before dumping.
I would not worry about it at all, unless you have a requirement that
your first ID be 1.
If it has master-master replication, the AUTO_INCREMENT must be set to
avoid collisions of the sequences for the id’s
Sorry, I was probably incorrect.
As pointed out by Walter below, “auto_increment” is just the initial
value
for the sequence.
And that will be higher than 1 when a few test records where inserted
…
“auto_increment_increment” is the “step” that is used to increment in
master-master set-ups …