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

Cannot create metadata table in DB2 when default table organization is set to column #1732

Closed
vojbarzz opened this issue Aug 2, 2017 · 1 comment

Comments

@vojbarzz
Copy link

vojbarzz commented Aug 2, 2017

What version of Flyway are you using?

4.2.0

Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin, SBT plugin, ANT tasks)

gradle plugin (but should be valid for any)

What database are you using (type & version)?

db2 11.1 with default table organization set to COLUMN

db2 get db cfg | grep DFT_TABLE_ORG
 Default table organization              (DFT_TABLE_ORG) = COLUMN
What operating system are you using?

windows

What did you do?

run the migration using gradlew flywayMigrate to populate empty db

What did you expect to see?

create a metadata table when blu acceleration as default.

What did you see instead?
* What went wrong:
Execution failed for task ':flywayMigrate'.
> Error occurred while executing flywayMigrate

Script failed
-------------
SQL State  : 42613
Error Code : -1666
Message    : CHECK
Line       : 17
Statement  : CREATE TABLE "LTS"."SCHEMA_VERSION_2017" (
    "installed_rank" INT NOT NULL,
    "version" VARCHAR(50),
    "description" VARCHAR(200) NOT NULL,
    "type" VARCHAR(20) NOT NULL,
    "script" VARCHAR(1000) NOT NULL,
    "checksum" INT,
    "installed_by" VARCHAR(100) NOT NULL,
    "installed_on" TIMESTAMP DEFAULT CURRENT TIMESTAMP NOT NULL,
    "execution_time" INT NOT NULL,
    "success" SMALLINT NOT NULL,
    CONSTRAINT "SCHEMA_VERSION_2017_s" CHECK ("success" in(0,1))
)

CHECK
Fix proposal

Update db2/createMetaDataTable.sql with ORGANIZE BY ROW option:

CREATE TABLE "${schema}"."${table}" (
    "installed_rank" INT NOT NULL,
    "version" VARCHAR(50),
    "description" VARCHAR(200) NOT NULL,
    "type" VARCHAR(20) NOT NULL,
    "script" VARCHAR(1000) NOT NULL,
    "checksum" INT,
    "installed_by" VARCHAR(100) NOT NULL,
    "installed_on" TIMESTAMP DEFAULT CURRENT TIMESTAMP NOT NULL,
    "execution_time" INT NOT NULL,
    "success" SMALLINT NOT NULL,
    CONSTRAINT "${table}_s" CHECK ("success" in(0,1))
)
ORGANIZE BY ROW;
@axelfontaine axelfontaine added this to the Flyway 5.0.0 milestone Sep 18, 2017
@axelfontaine axelfontaine changed the title Cannot create metadata table in DB2 when default table organization is se to column Cannot create metadata table in DB2 when default table organization is set to column Nov 17, 2017
axelfontaine pushed a commit to flyway/flywaydb.org that referenced this issue Nov 17, 2017
@axelfontaine
Copy link
Contributor

This has now been fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants