You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
START TRANSACTION;
ALTER TABLE foo DROP CONSTRAINT pk_foo;
ALTER TABLE foo RENAME TO foos;
ALTER TABLE foos ADD CONSTRAINT pk_foos PRIMARY KEY (id);
COMMIT;
To rename the table foo in foos and also its primary key, the diff output doesn't still include sequences difference:
I have been able to replicate it using Liquibase versions 4.27.0 and 4.28.0. The same thing happens if the two tables are identical but the primary key constraint has a different name:
For the first database run
CREATE TABLE public.foo (
id int4 GENERATED BY DEFAULT AS IDENTITY( INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START 1 CACHE 1 NO CYCLE) NOT null,
CONSTRAINT pk_foo PRIMARY KEY (id)
);
For the second one run
CREATE TABLE public.foo (
id int4 GENERATED BY DEFAULT AS IDENTITY( INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START 1 CACHE 1 NO CYCLE) NOT null,
CONSTRAINT pk_foos PRIMARY KEY (id)
);
The sequence difference won't appear in the diff output:
Search first
Description
Sequences not included in diff result.
Steps To Reproduce
Let's create two databases liq1 and liq2:
with one single table each: foo in liq1 and foos liq2. Query to create the tables:
Database liq1 table foo:
Database liq2 table foos:
If I run the liquid diff command with the following liquibase.properties file:
The result is the following:
There's no entry for the sequences but looking at the db schema:
liq1:
liq2:
Expected/Desired Behavior
I would expect an output that include the following:
Liquibase Version
4.27.0
Database Vendor & Version
PostgreSQL 16.2
Liquibase Integration
No response
Liquibase Extensions
No response
OS and/or Infrastructure Type/Provider
No response
Additional Context
If I run the following in liq1:
To rename the table foo in foos and also its primary key, the diff output doesn't still include sequences difference:
log file of the first diff run:
liquibase1.log
log file of the second diff run:
liquibase2.log
Are you willing to submit a PR?
The text was updated successfully, but these errors were encountered: