postgresql - Why does Liquibase want to dropPrimaryKey and addPrimaryKey? -
i have postgres databases generated eclipse link. between these databases not change, when run liquibase generating diffchangelog, generates changesets dropprimarykey , addprimarykey. don't understand why generates these records primary keys of tables. names, order of columns same both tables.
example of changeset
<changeset author="michal2 (generated)" id="1436872322297-8"> <dropprimarykey tablename="country_translation"/> <addprimarykey columnnames="country_id, translations_id" constraintname="country_translation_pkey" tablename="country_translation"/> </changeset>
sql of original table
create table country_translation ( country_id bigint not null, translations_id bigint not null, constraint country_translation_pkey primary key (country_id, translations_id), constraint fk_country_translation_country_id foreign key (country_id) references country (id) match simple on update no action on delete no action, constraint fk_country_translation_translations_id foreign key (translations_id) references translation (id) match simple on update no action on delete no action ) ( oids=false ); alter table country_translation owner hotels;
sql of reference table
create table country_translation ( country_id bigint not null, translations_id bigint not null, constraint country_translation_pkey primary key (country_id, translations_id), constraint fk_country_translation_country_id foreign key (country_id) references country (id) match simple on update no action on delete no action, constraint fk_country_translation_translations_id foreign key (translations_id) references translation (id) match simple on update no action on delete no action ) ( oids=false ); alter table country_translation owner hotels;
liquibase command arguments
./liquibase \ --driver=org.postgresql.driver \ --classpath=/home/michal2/tools/postgresql-jdbc-driver/postgresql-jdbc.jar \ --changelogfile=changelog-hotels.xml \ --url="jdbc:postgresql://localhost/hotels" \ --username=hotels \ --password=hotels \ --defaultschemaname=public \ --loglevel=info \ diffchangelog \ --referenceurl="jdbc:postgresql://localhost/hotels_liquibase" \ --referenceusername=hotels \ --referencepassword=hotels \ --referencedefaultschemaname=public
i'm using version 3.4.0
this has been fixed liquibase 3.4.1 https://liquibase.jira.com/browse/core-2416
Comments
Post a Comment