New issue 169 by KrisMul...@gmail.com: Specify default tablespace for oracle
http://code.google.com/p/flyway/issues/detail?id=169
I would like to be able to specify a tablespace name from the config for
where the schema_version table will be created, is this a possible
enhancement?
i.e.
CREATE TABLE ${schema}.${table} (
version VARCHAR2(20) NOT NULL PRIMARY KEY,
description VARCHAR2(100),
type VARCHAR2(10) NOT NULL,
script VARCHAR2(200) NOT NULL UNIQUE,
checksum INT,
installed_by VARCHAR2(30) NOT NULL,
installed_on TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
execution_time INT,
state VARCHAR2(15) NOT NULL,
current_version NUMBER(1) NOT NULL
) TABLESPACE ${tablespace};
CREATE INDEX ${schema}.${table}_cv_idx ON ${schema}.${table}
(current_version);
Reason being, i ran into the issue where the user's default tablespace no
longer existed, Caused by: liquibase.exception.DatabaseException: Error
executing SQL CREATE TABLE DATABASECHANGELOGLOCK (ID INTEGER NOT NULL,
LOCKED NUMBER(1) NOT NULL, LOCKGRANTED TIMESTAMP, LOCKEDBY VARCHAR2(255),
CONSTRAINT PK_DATABASECHANGELOGLOCK PRIMARY KEY (ID)); on JDBCSTUFFHERE
tablespace 'MISC_DATA_2' does not exist.
My migrations specify the tablespace but the schema_version thats created
does not, to get around this I had to create the changeloglock table myself
(now I know it could also be fixed with alter user, but I could see this as
being useful to others possibly...)
[INFO] Flyway Error: com.googlecode.flyway.core.exception.FlywayException:
Error
executing statement at line 17: CREATE TABLE SCHEMA.schema_version (
version VARCHAR2(20) NOT NULL PRIMARY KEY,
description VARCHAR2(100),
type VARCHAR2(10) NOT NULL,
script VARCHAR2(200) NOT NULL UNIQUE,
checksum INT,
installed_by VARCHAR2(30) NOT NULL,
installed_on TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
execution_time INT,
state VARCHAR2(15) NOT NULL,
current_version NUMBER(1) NOT NULL
)
ORA-00959: tablespace 'MISC_DATA_2' does not exist
Comment #3 on issue 169 by axel.fontai...@gmail.com: Specify
default tablespace for oracle
http://code.google.com/p/flyway/issues/detail?id=169
Hi Kris,
thanks for your suggestion! We'll look into it as a possible improvement
for a future release.
Cheers,
Axel
Couldn't you just connect to the database with a user that has the default
tablespace that you want? You can then use this user as a deploy user for
the schemas that you plan on controlling via flyway.