Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
Thread: Comparing Schemas
05-13-2011, 08:58 PM #1
- Join Date
- Jun 2007
- Los Angeles
- Thanked 5 Times in 5 Posts
I was comparing two databases and noticed the only differences was in the AUTO_INCREMENT=xxx part at the end. As shown below this table has an auto_increment of 600 and in the other table it's a different value.
The two databases are supposed to be the same as one site is my development site and the other site is my production site.
I don't understand what the AUTO_INCREMENT=xxx part is defining and why it would have different values for tables which are supposed to be the same?
Do I need to manually sync these two values so they are the same?
CREATE TABLE IF NOT EXISTS `Phone_Numbers` (
`id` int(11) NOT NULL auto_increment,
`company_index` int(11) NOT NULL default '0',
`phone_number` varchar(16) NOT NULL,
PRIMARY KEY (`id`),
KEY `company_index` (`company_index`),
KEY `phone_number` (`phone_number`)
) ENGINE=MyISAM DEFAULT CHARSET=latin1 AUTO_INCREMENT=600;
Business Text Messaging Services
05-13-2011, 11:15 PM #2
An AUTO_INCREMENT field is one where the *database* automatically inserts a UNIQUE incremental number each time you add a record.
Unless both databases were created at the same time and *ALL* the records were inserted into both of them *IN THE SAME ORDER*, then of course the auto_number field values will be different.
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.
Users who have thanked Old Pedant for this post: