DATACOM - Diego
2007-08-01 17:36:45 UTC
Hi all,
I am trying to use Liquibase 1.1.1 on Firebird 1.5 using the Ant task.
When I try to migrate the database for the first time, the build fails
with this error:
updateDatabase:
[migrateDatabase] 01/08/2007 12:14:35
liquibase.database.DatabaseFactory findCorrectDatabaseImplementation
[migrateDatabase] WARNING: Unknown database: Firebird
[migrateDatabase] 01/08/2007 12:14:36
liquibase.database.AbstractDatabase checkDatabaseChangeLogTable
[migrateDatabase] INFO: Creating database history table with name:
DATABASECHANGELOG
BUILD FAILED
E:\workspace3.2\liquibase_test\build.xml:41:
liquibase.migrator.exception.MigrationFailedException:
liquibase.migrator.exception.JDBCException:
org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544351.
unsuccessful metadata update
key size too big for index RDB$PRIMARY446
Firebird 1.5 has a restriction that an index cannot exceed 252 bytes
(this seems to have increased in Firebird 2). To overcome this, I am
creating the table manually using smaller column sizes (the CREATE
used by Liquibase can be found on class AbstractDatabase):
CREATE TABLE databasechangelog(
id VARCHAR(30) NOT NULL,
author VARCHAR(50) NOT NULL,
filename VARCHAR(255) NOT NULL,
dateexecuted TIMESTAMP NOT NULL,
md5sum VARCHAR(32),
description VARCHAR(255),
comments VARCHAR(255),
tag VARCHAR(255),
liquibase VARCHAR(10)
);
ALTER TABLE databasechangelog ADD CONSTRAINT databasechangelog_pk
PRIMARY KEY (id, author);
This is not the better solution, of course. I wonder if there is any
possibility that these sizes be changed in Liquibase. Maybe avoiding
such a big primary key would be an even better solution. I thought the
CREATE could become something like this:
CREATE TABLE databasechangelog (
id NUMERIC(10) NOT NULL,
name VARCHAR(255) NOT NULL,
author VARCHAR(255) NOT NULL,
filename VARCHAR(255) NOT NULL,
dateexecuted TIMESTAMP NOT NULL,
md5sum VARCHAR(32),
description VARCHAR(255),
comments VARCHAR(255),
tag VARCHAR(255),
liquibase VARCHAR(10)
);
ALTER TABLE databasechangelog ADD CONSTRAINT databasechangelog_pk
PRIMARY KEY (id);
Here the previous "id" column was renamed to "name" and a new numeric
"id" column was created to serve as primary key. I think this is more
elegant and can be more efficient too.
What do you think?
I am trying to use Liquibase 1.1.1 on Firebird 1.5 using the Ant task.
When I try to migrate the database for the first time, the build fails
with this error:
updateDatabase:
[migrateDatabase] 01/08/2007 12:14:35
liquibase.database.DatabaseFactory findCorrectDatabaseImplementation
[migrateDatabase] WARNING: Unknown database: Firebird
[migrateDatabase] 01/08/2007 12:14:36
liquibase.database.AbstractDatabase checkDatabaseChangeLogTable
[migrateDatabase] INFO: Creating database history table with name:
DATABASECHANGELOG
BUILD FAILED
E:\workspace3.2\liquibase_test\build.xml:41:
liquibase.migrator.exception.MigrationFailedException:
liquibase.migrator.exception.JDBCException:
org.firebirdsql.jdbc.FBSQLException: GDS Exception. 335544351.
unsuccessful metadata update
key size too big for index RDB$PRIMARY446
Firebird 1.5 has a restriction that an index cannot exceed 252 bytes
(this seems to have increased in Firebird 2). To overcome this, I am
creating the table manually using smaller column sizes (the CREATE
used by Liquibase can be found on class AbstractDatabase):
CREATE TABLE databasechangelog(
id VARCHAR(30) NOT NULL,
author VARCHAR(50) NOT NULL,
filename VARCHAR(255) NOT NULL,
dateexecuted TIMESTAMP NOT NULL,
md5sum VARCHAR(32),
description VARCHAR(255),
comments VARCHAR(255),
tag VARCHAR(255),
liquibase VARCHAR(10)
);
ALTER TABLE databasechangelog ADD CONSTRAINT databasechangelog_pk
PRIMARY KEY (id, author);
This is not the better solution, of course. I wonder if there is any
possibility that these sizes be changed in Liquibase. Maybe avoiding
such a big primary key would be an even better solution. I thought the
CREATE could become something like this:
CREATE TABLE databasechangelog (
id NUMERIC(10) NOT NULL,
name VARCHAR(255) NOT NULL,
author VARCHAR(255) NOT NULL,
filename VARCHAR(255) NOT NULL,
dateexecuted TIMESTAMP NOT NULL,
md5sum VARCHAR(32),
description VARCHAR(255),
comments VARCHAR(255),
tag VARCHAR(255),
liquibase VARCHAR(10)
);
ALTER TABLE databasechangelog ADD CONSTRAINT databasechangelog_pk
PRIMARY KEY (id);
Here the previous "id" column was renamed to "name" and a new numeric
"id" column was created to serve as primary key. I think this is more
elegant and can be more efficient too.
What do you think?
--
DIEGO Moreira da Rosa
DATACOM
Av França, 735 - Porto Alegre, RS - 90230-220
DDR: +55 51 3358 0141
Fax: +55 51 3358 0101
site: www.datacom.ind.br
DIEGO Moreira da Rosa
DATACOM
Av França, 735 - Porto Alegre, RS - 90230-220
DDR: +55 51 3358 0141
Fax: +55 51 3358 0101
site: www.datacom.ind.br