Hello,

You're right, thanks for reporting. This seems to have gone forgotten. The
ALTER TABLE statement does consider the nullable flag.

I've registered an issue for this, which is already fixed on GitHub master
and will be merged to 3.5.1:
https://github.com/jOOQ/jOOQ/issues/3803

I've also discovered similar issues with ALTER TABLE:
https://github.com/jOOQ/jOOQ/issues/3805

Thanks again for reporting,
Lukas

2014-11-25 23:49 GMT+01:00 Andrey Antukh <[email protected]>:

> Hello!
>
> I'm playing with new ddl api of jOOQ 3.5 and I found some strange behavior.
>
> I'll try translate my clojure code to Java:
>
> DataType type = PostgresDataType.VARCHAR.length(2).nullable(false);
> DSL.alterTable("t1").add(DSL.field("title"), type);
>
> Will result in (as expected):
> "alter table t1 add title varchar(2) not null"
>
> DataType type = PostgresDataType.VARCHAR.length(2).nullable(false);
> DSL.createTable("t1").column(DSL.field("title"), type);
>
> Will result in:
> "create table t1(title varchar(2))"
>
> Seems that createTable does not respects the nullable flag of type. This
> is expected behavior?
> Additionally, seems that I can not set default value for field when a
> creating the table, that is so?
>
> Thank you very much.
>
> Regards.
> Andrey
>
> --
> Andrey Antukh - Андрей Антух - <[email protected]> / <
> [email protected]>
> http://www.niwi.be <http://www.niwi.be/page/about/>
> https://github.com/niwibe
>
> --
> 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].
> For more options, visit https://groups.google.com/d/optout.
>

-- 
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].
For more options, visit https://groups.google.com/d/optout.

Reply via email to