I have been successful in extracting data to CSV files and creating a changeLog.xml to load the data:
liquibase generate-changelog --diffTypes=data --dataOutputDirectory=datafiles --changelog-file=loadData_changeLog.xml
The CSV files are good, and the changeLog.xml is valid but flawed.
I need to load the tables in a specific order due to ForeignKey constraints in the tables.
In my liquibase.properties file, I specify, in hierarchical order, the tables I want to extract.
includeObjects: table:my_table_1, table:my_table_2, table:my_table_3
But, the resulting changelog.xml creates the <changeSet … tableName=“my_table_3”> in an unknown order. It is not alphabetical, and it is not in the order of the properties file.
How is Liquibase ordering the changesets in the Changelog?
How can I instruct Liquibase to respect the order I specify, or better yet to examine the database and respect the foreignkey constraints?