mysql - SymmetricDS messes up with tripple foreign key -



mysql - SymmetricDS messes up with tripple foreign key -

i have database supposed synchronized using symmetricds. there next queries, building base:

create table `defectstdreference` ( `std_doc_id` bigint(20) not null comment 'Идентификатор НТД', `improve_notice_doc_id` bigint(20) not null comment 'Идентификатор предписания', `defect_id` int(11) not null comment 'Идентификатор дефекта', `paragraph` varchar(4000) not null comment 'Пункт НТД', `reference_id` bigint(20) not null auto_increment comment 'Идентификатор ссылки на пункт НТД', `client_id` bigint(20) default null, primary key (`reference_id`), key `relationship70` (`std_doc_id`), key `relationship72` (`improve_notice_doc_id`,`defect_id`,`client_id`), constraint `relationship70` foreign key (`std_doc_id`) references `std` (`doc_id`) on delete no action on update no action, constraint `relationship72` foreign key (`improve_notice_doc_id`, `defect_id`, `client_id`) references `improvementnoticedefect` (`doc_id`, `defect_id`, `client_id`) on delete no action on update no action ) engine=innodb auto_increment=17 default charset=utf8 comment='Ссылки на НТД выявленных нарушений';

and table referenced:

create table `improvementnoticedefect` ( `description` varchar(20000) not null comment 'Описание нарушения', `defect_id` int(11) not null comment 'Номер нарушения в рамках предписания', `doc_id` bigint(20) not null comment 'Номер документа "Предписание"', `client_id` bigint(20) not null, primary key (`doc_id`,`defect_id`,`client_id`), key `relationship68` (`doc_id`,`client_id`), constraint `relationship68` foreign key (`doc_id`, `client_id`) references `improvementnotice` (`doc_id`, `client_id`) on delete no action on update no action ) engine=innodb default charset=utf8 comment='Дефект';

as can see, order of columns in primary key of table impovementnoticedefect , in fk constraint 72 of defectstdreference same.

yet, when synchronization started, symmetricds gives me error:

cannot add together foreign key constraint. failed execute: alter table `defectstdreference` add together constraint `relationship72` foreign key (`improve_notice_doc_id`, `defect_id`, `client_id`) references `improvementnoticedefect` (`doc_id`, `defect_id`, `client_id`)

and when seek dump sql table symmetricds created following:

create table `improvementnoticedefect` ( `defect_id` int(11) not null, `doc_id` bigint(20) not null, `client_id` bigint(20) not null, `description` varchar(20000) not null, primary key (`defect_id`,`doc_id`,`client_id`), key `relationship68` (`doc_id`,`client_id`), constraint `relationship68` foreign key (`doc_id`, `client_id`) references `improvementnotice` (`doc_id`, `client_id`) ) engine=innodb default charset=utf8;

as can see, order of fields in primary key different.

i tried running erroneous query manually, , gave error, when changed order of fields, fine.

how can prepare this? there configuration should or smth? i'm desperate here, can help?

update have realized, problem symmetricds uses xml send tables, , pk created xml:

<!doctype database scheme "http://db.apache.org/torque/dtd/database"> <database name="dataextractor"> <table name="improvementnoticedefect"> <column name="defect_id" primarykey="true" required="true" type="integer" size="10"> <platform-column name="mysql" type="int" size="10"/> </column> <column name="doc_id" primarykey="true" required="true" type="bigint" size="19"> <platform-column name="mysql" type="bigint" size="19"/> </column> <column name="client_id" primarykey="true" required="true" type="bigint" size="19"> <platform-column name="mysql" type="bigint" size="19"/> </column> <column name="description" required="true" type="varchar" size="20000"> <platform-column name="mysql" type="varchar" size="20000"/> </column> <foreign-key name="relationship68" foreigntable="improvementnotice"> <reference local="doc_id" foreign="doc_id"/> <reference local="client_id" foreign="client_id"/> </foreign-key> </table> </database>

and can see, xml primary key generated in order of created columns, wrong

mysql jdbc symmetricds

Comments

Popular posts from this blog

java - How to set log4j.defaultInitOverride property to false in jboss server 6 -

c - GStreamer 1.0 1.4.5 RTSP Example Server sends 503 Service unavailable -

Using ajax with sonata admin list view pagination -