# Generating a loadData change log in a specified order

**URL:** https://forum.liquibase.org/t/generating-a-loaddata-change-log-in-a-specified-order/9062
**Category:** General Discussion
**Created:** [January 31, 2024, 3:53pm UTC](https://forum.liquibase.org/t/generating-a-loaddata-change-log-in-a-specified-order/9062 "2024-01-31T15:53:56Z")
**Posts on this page:** 1
**Page:** 1

<div class="post-metadata">

### Author: ![JoeData](https://avatars.discourse-cdn.com/v4/letter/j/258eb7/32.png) [@JoeData](https://forum.liquibase.org/u/JoeData)
#### Post date: [January 31, 2024, 3:53pm UTC](https://forum.liquibase.org/t/generating-a-loaddata-change-log-in-a-specified-order/9062/1 "2024-01-31T15:53:56Z")

</div>

I have been successful in extracting data to CSV files and creating a changeLog.xml to load the data:

```auto
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.

```auto
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?
