On Mon, Mar 18, 2024 at 10:26 PM Marcel Overdijk <[email protected]>
wrote:

> Related to generating the schema ddl I found there is the dsl.ddl(schema)
> method of jooq.


Great that you've found it! :)


> I noticed it generates the ddl in the order:
> create table country ...
> create index ...
> alter table country add constraint CONSTRAINT_2E foreign key
> (continent_id) references continent (id)
>
> which causes:
>
> > SQL [alter table country add constraint CONSTRAINT_2E foreign key
> (continent_id) references continent (id)]; [SQLITE_ERROR] SQL error or
> missing database (near "constraint": syntax error)
>

Can you please create an issue:
https://github.com/jOOQ/jOOQ/issues/new/choose


> PS: I understand that for creating the constraints inline in the create
> table statement, the order of the tables is important.
> And I also see that when using the DDLDatabase in the codegen there is no
> order maintained in the generated schema class.
> So not sure if this can work at all.
>

We can do a topological sort.

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/jooq-user/CAB4ELO7KcYd-2%2Br0DLvM--kzAvS1Vg9r8Y34Gm2LOx216dMJkA%40mail.gmail.com.

Reply via email to