Page 1 of 1
Order of columns with schema comparison
Posted: Fri 14 Dec 2012 08:40
by Patrick8639
Hello,
if I change the order of the columns in a table, make a schema comparison with a copy of the table and synchronize the schemas, the order of the columns are not changed in the destination table. So we can't really say that the schemas are the same.
If you don't want to make this automatically, at least provide it as an option to the comparison.
Patrick
Re: Order of columns with schema comparison
Posted: Fri 14 Dec 2012 11:45
by alexa
We will review this suggestion when developing next versions of the product.
Re: Order of columns with schema comparison
Posted: Tue 23 Apr 2013 13:26
by alexa
Re: Order of columns with schema comparison
Posted: Tue 23 Apr 2013 15:56
by Patrick8639
Thanks Alexa.
Re: Order of columns with schema comparison
Posted: Fri 10 May 2013 15:26
by Patrick8639
Alexa,
it's working... but not always.
I just change the fields order for about 10 tables. When synchronizing between the distant server and my one server, I had to run synchronization multiple times to have the destination tables with the correct field order.
At the end, I still have a table that don't want to be synchronized!!!!
Patrick
Re: Order of columns with schema comparison
Posted: Fri 10 May 2013 15:32
by Patrick8639
Alexa,
the source table schema is:
Code: Select all
CREATE TABLE asloca_intervention (
CreationDT DATETIME NOT NULL DEFAULT '2013-01-01 00:00:00',
CreationUser INT(11) DEFAULT 1,
IsDeleted TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
No INT(11) NOT NULL AUTO_INCREMENT,
LastChangeDT DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
LastChangeUser INT(11) NOT NULL DEFAULT 1,
Version INT(11) NOT NULL DEFAULT 1,
Address VARCHAR(100) DEFAULT NULL,
AddressNo SMALLINT(5) UNSIGNED DEFAULT NULL,
AddressNoExt VARCHAR(10) DEFAULT NULL,
City VARCHAR(100) DEFAULT NULL,
Date DATE NOT NULL,
Gerance VARCHAR(50) DEFAULT NULL,
Location TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
NoConsultant INT(11) NOT NULL,
NoMember INT(11) NOT NULL,
Text TEXT DEFAULT NULL,
Type TINYINT(3) UNSIGNED NOT NULL,
ZipNo INT(11) NOT NULL DEFAULT 0,
LastChangeWho INT(11) NOT NULL,
PRIMARY KEY (No),
INDEX ByConsultant (NoConsultant),
INDEX ByNoMember (NoMember)
)
ENGINE = INNODB
CHARACTER SET utf8
COLLATE utf8_general_ci
COMMENT = 'Liste des interventions'
The destination table is:
Code: Select all
CREATE TABLE asloca_intervention (
CreationDT DATETIME NOT NULL DEFAULT '2013-01-01 00:00:00',
CreationUser INT(11) DEFAULT 1,
IsDeleted TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
No INT(11) NOT NULL AUTO_INCREMENT,
LastChangeDT DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00',
LastChangeUser INT(11) NOT NULL DEFAULT 1,
Version INT(11) NOT NULL DEFAULT 1,
Address VARCHAR(100) DEFAULT NULL,
AddressNo SMALLINT(5) UNSIGNED DEFAULT NULL,
AddressNoExt VARCHAR(10) DEFAULT NULL,
City VARCHAR(100) DEFAULT NULL,
Date DATE NOT NULL,
Gerance VARCHAR(50) DEFAULT NULL,
Text TEXT DEFAULT NULL,
Type TINYINT(3) UNSIGNED NOT NULL,
ZipNo INT(11) NOT NULL DEFAULT 0,
LastChangeWho INT(11) NOT NULL,
Location TINYINT(3) UNSIGNED NOT NULL DEFAULT 0,
NoConsultant INT(11) NOT NULL,
NoMember INT(11) NOT NULL,
PRIMARY KEY (No),
INDEX ByConsultant (NoConsultant),
INDEX ByNoMember (NoMember)
)
ENGINE = INNODB
CHARACTER SET utf8
COLLATE utf8_general_ci
COMMENT = 'Liste des interventions'
The synchronization script is:
Code: Select all
USE asloca;
--
-- Alter table "asloca_intervention"
--
ALTER TABLE asloca_intervention
CHANGE COLUMN Location Location TINYINT(3) UNSIGNED NOT NULL DEFAULT 0 AFTER Gerance,
CHANGE COLUMN Text Text TEXT DEFAULT NULL AFTER NoMember;
It seems that something is missing in the script.
The next time I run the synchronization, there are still other changes and it seems to never ends...
Patrick
Re: Order of columns with schema comparison
Posted: Mon 13 May 2013 14:12
by alexa
We are currently investigating this issue and will answer you as soon as possible.
Re: Order of columns with schema comparison
Posted: Wed 14 Aug 2013 07:57
by Patrick8639
Alexa,
with version 6.0.399, the schema comparison tool says that the tables are equal, even if the order of the columns are not the same!
Patrick
Re: Order of columns with schema comparison
Posted: Wed 14 Aug 2013 12:14
by alexa
Could you please provide us the versions of the compared MySQL servers and specify the options you have selected on the Options page of the New Schema Comparison wizard?
Re: Order of columns with schema comparison
Posted: Wed 14 Aug 2013 12:36
by Patrick8639
Alexa,
it's OK now: the Force column order setting was not checked in this comparison.
Sorry.
Patrick
Re: Order of columns with schema comparison
Posted: Wed 14 Aug 2013 12:39
by alexa
Thank you for updating us on this issue.
Please let us know if you have any questions.