如何使用flyway和Java为Postgres DB动态创建表空间?

问题描述

如何使用flyway和Java为Postgres DB动态创建表空间?在执行SQL查询之前尝试创建表空间

Flyway flyway = Flyway.configure().dataSource(jdbcTemplate.getDataSource()).baselineOnMigrate(true).locations(migScriptLoc)
                .schemas(schemaName).tablespace("test").locations(locations).load();

这给了我下面的错误

enter code hereWrapped by: org.flywaydb.core.internal.sqlscript.FlywaysqlScriptException: 
Migration  Failed
-----------------
sql State  : 42704
Error Code : 0
Message    : ERROR: tablespace "test" does not exist
Location   :  ()
Line       : 1
Statement  : CREATE TABLE "master"."flyway_schema_history" (
    "installed_rank" INT NOT NULL,"version" VARCHAR(50),"description" VARCHAR(200) NOT NULL,"type" VARCHAR(20) NOT NULL,"script" VARCHAR(1000) NOT NULL,"checksum" INTEGER,"installed_by" VARCHAR(100) NOT NULL,"installed_on" TIMESTAMP NOT NULL DEFAULT Now(),"execution_time" INTEGER NOT NULL,"success" BOOLEAN NOT NULL
) TABLESPACE "test" 

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)