create.alterTable("preferences").alterColumn("name").defaultValue("abc"
).execute();
=> alter table `preferences` change column `name` `name` set default 'abc'
=> You have an error in your SQL syntax; check the manual that corresponds
to your MySQL server version for the right syntax to use near 'default
'abc'' at line 1
MySQL has three different syntaxes depending on what you're trying to do.
It appears that JOOQ is using the wrong one when trying to set the default
value.
| ALTER [COLUMN] *col_name* {SET DEFAULT *literal* | DROP DEFAULT}
| CHANGE [COLUMN] *old_col_name* *new_col_name* *column_definition*
[FIRST|AFTER *col_name*]
| MODIFY [COLUMN] *col_name* *column_definition*
[FIRST | AFTER *col_name*]
The generated SQL should be: alter table `preferences` alter column `name`
set default 'abc'
There is an example very similar to this in the documentation which
suggests that it is intended to work.
--
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.