Generatedchangelog not generating all sequences

Hello,

I am trying to generatechangelog all my sequences but i am not possible to do it.

I have created a postgres database via SQL files and i am trying to export that DB to XML.

I have created 1 sequence in SQL via

“create sequence test if not exists”

and there are other 9 sequences which has been auto created by the creation of table by having Serial datatype for ID’s.

So when i am trying to export all those 10 sequences I m able to have only the one which has been created by the “create sequence” command and nothing else.

Is there any way to get all those 10 sequences to XML?

Hi @michey Thanks you for joining the community. Liquibase should be able to retrieve the sequences. I will test to see what is different in your environment. Do you have the scripts that were used to create your tables? Of course, abstracting any proprietary or customer data.

Hello Mike,
I am attaching my XML below. When i run a liquibase command to generate sequences, it does not create any XML for that sequences of ID’s.

liquibase --changeLogFile=2_inserts.sql --url=“jdbc:postgresql://localhost:5432/postgres” --username=postgres --password=postgres --driver=org.postgresql.Driver --defaultSchemaName=public --diffTypes=data generateChangeLogliquibase --changeLogFile=sec.xml --url=“jdbc:postgresql://localhost:5432/referencedata_db” --username=postgres --password=postgres --driver=org.postgresql.Driver --liquibaseSchemaName=referencedata_db --diffTypes=sequences generateChangeLog

<changeSet author="mike" id="1642677628909-1">
    <createTable tableName="list">
        <column autoIncrement="true" name="id" type="BIGINT">
            <constraints nullable="false" primaryKey="true" primaryKeyName="list_pkey"/>
        </column>
        <column name="key" type="VARCHAR(255)">
            <constraints nullable="false"/>
        </column>
        <column name="type" type="VARCHAR(30)"/>
        <column name="ui_editable" type="BOOLEAN"/>
    </createTable>
</changeSet>
<changeSet author="mike" id="1642677628909-2">
    <createTable tableName="list_item">
        <column autoIncrement="true" name="id" type="BIGINT">
            <constraints nullable="false" primaryKey="true" primaryKeyName="list_item"/>
        </column>
        <column name="cd" type="VARCHAR(255)">
            <constraints nullable="false"/>
        </column>
        <column name="edit" type="BOOLEAN"/>
        <column name="valid_from" type="TIMESTAMP WITHOUT TIME ZONE">
            <constraints nullable="false"/>
        </column>
        <column name="valid_to" type="TIMESTAMP WITHOUT TIME ZONE"/>
        <column name="list_id" type="BIGINT"/>
    </createTable>
</changeSet>

@michey I am curious if this also reproduces if you create the table and id column without autoIncrement=“true” property set inline but introduce a new, standalone changeset, after the createTable. This changeset is of type: addAutoIncrement | Liquibase Docs

Then of course, re-run the generateChangeLog…