Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extended @Column support for DB2 #2601

Merged
merged 6 commits into from
Mar 17, 2022
Merged

Conversation

rPraml
Copy link
Contributor

@rPraml rPraml commented Mar 17, 2022

We add in this commit extended support for @Column for DB2 platform.
In DB2 we have the situation, that a @Lob has a default size of 1M, So we added the feature #2563 to add a platform specific definition.

This caused one issue, that unnecessary migrationscripts were created for platforms, that are not listed in @Column.
So @Column(columnDefinition = "db2;clob(16K)") -> @Column(columnDefinition = "db2;clob(32K)") should not generate migrations for other platforms than DB2 (fixed here: DbMigration: Do only real type changes =

We had also a problem, that it was not possible to use @DbDefault together with @Column because dbColumDefault returned null in this case.

The next thing is, that we want to do complex definitions like @Column(columnDefinition = "db2;clob(16K) inline length 500 compact;")
So this is valid for adding a new column, but not valid for an "alter column" statement (it must be done in two statements and things like 'compact' and 'logged' statements cannot be altered on exisiting columns.

We implemented a small parser that allow such statements both for column creation and for column alternation.
Support for extra colum options for DB2

…on is specified (cases no DDL change)

We support optional platform columnDefinitions now. E.g. "db2;clob(64M);" - so we must not ignore @DbDefault for all other platforms
@rbygrave
Copy link
Member

Yes, looks nice. Good stuff.

@rbygrave rbygrave added the bug label Mar 17, 2022
@rbygrave rbygrave added this to the 12.16.1 milestone Mar 17, 2022
@rbygrave rbygrave merged commit d540bf4 into ebean-orm:master Mar 17, 2022
@rPraml rPraml deleted the ddl-refactor9 branch August 10, 2023 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants