Skip to Main Content

SQLcl: MCP Server & SQL Prompt

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

SQLcl Project: Wrong order in stage.changelog.sql when using generatedFormat: sql

Patrizia Regenberg5 days ago — edited 3 days ago

Description:
When running project stage with SQLcl 25.2.2 and generatedFormat set to sql in project.config.json, the generated stage.changelog.sql has an incorrect ordering of objects.
It starts by creating foreign keys first, and only afterwards creates the tables. This results in deployment failures since the referenced tables do not yet exist when the foreign keys are applied.

To verify, I tested with generatedFormat: liquibase. In this case, the generated changelog.xml has the correct ordering — tables first, then foreign keys. This shows the issue is specific to the SQL output format.

Steps to Reproduce:

  1. In project.config.json, set "generatedFormat": "sql".
  2. Run project stage.
  3. Inspect stage.changelog.sql.

Expected:
Tables created first, then foreign keys.

Actual:
Foreign keys come first, then tables.

Environment:

SQLcl project version: 25.2.2

Question:

Is this a bug? And if so, is there any workaround that I could use?

Comments
Post Details
Added 5 days ago
0 comments
39 views