DbMaintain / dbmaintain

DEPRECATED: DbMaintain enables automatic roll-out of updates to a relational database
https://dbmaintain.github.io
Apache License 2.0
17 stars 12 forks source link

Schema name in updateDatabase ant task is not working #4

Closed jayarampradhan closed 9 years ago

jayarampradhan commented 9 years ago

Hi,

I am trying to use, H2 in mysql mode. dbmaintain version: 2.6.0 which has h2 support

When I am running a updateDatabase ant task I am getting the below error: Schema "test" not found; SQL statement: create table "test"."dbmaintain_scripts" ( file_name VARCHAR(150), file_last_modified_at BIGINT, checksum VARCHAR(50), executed_at VARCHAR(20), succeeded BIGINT ) [90079-187]

complete code: `<updateDatabase scriptLocations="../../db/migration/" autoCreateDbMaintainScriptsTable="true" cleanDb="true" >

    </updateDatabase>`

Please let me know if I am missing something.

remast commented 9 years ago

The problem is you set "SET SCHEMA public" in your JDBC url which means you are connected to the schema public. Yet you configure "schemaNames="test" so dbmaintain runs all commands for the schema test. As test and public are separate schemata that can't work. So you shoud connect to the schema test in your JDBC url and it will work.