Flyway

Flyway: create view as WITH (common table expression CTE)

不打扰是莪最后的温柔 提交于 2019-12-13 03:18:07
问题 How to overcome that error? Java version: 1.8.0_131, vendor: Oracle Corporation, runtime: C:\Program Files\Java\jdk1.8.0_131\jre [DEBUG] com.oracle:ojdbc8:jar:12.2.0.1.0:provided [INFO] Flyway Community Edition 5.2.4 by Boxfuse [INFO] Database: jdbc:oracle:thin:@bdlg3400.na.pg.com:1525:ioptd101 (Oracle 12.2) [DEBUG] Driver : Oracle JDBC driver 12.2.0.1.0 [ERROR] Migration R__SOME_VIEW_VW.sql failed [ERROR] -------------------------------------- [ERROR] SQL State : 42000 [ERROR] Error Code :

Flyway: Cannot find migrations location in: [classpath:db/migration]

天大地大妈咪最大 提交于 2019-12-12 14:29:44
问题 I created an new project with springboot2.2.0.M2 / Flyway 5.2.4 / Java8. After try to start my project i got : . ____ _ __ _ _ /\\ / ___'_ __ _ _(_)_ __ __ _ \ \ \ \ ( ( )\___ | '_ | '_| | '_ \/ _` | \ \ \ \ \\/ ___)| |_)| | | | | || (_| | ) ) ) ) ' |____| .__|_| |_|_| |_\__, | / / / / =========|_|==============|___/=/_/_/_/ :: Spring Boot :: (v2.1.4.RELEASE) 2019-04-22 13:36:54.574 INFO 17268 --- [ restartedMain] com.example.demo214.Demo214Application : Starting Demo214Application on xx

Can Flyway find out and generate migration files from datamodel?

為{幸葍}努か 提交于 2019-12-12 14:27:40
问题 Ey everyone! :) I have been having a look at Flyway but I am not sure about how I can use it. In my case, I have an entity model (annotated using JPA) and, for me, the useful it would be that FlyWay could find out the changes on my model every time I call "migration" and generate the migration files. That is the way such as Rails works (Rails uses a DSL but I hope you understand what I mean). As I have read in the wiki, Flyway does not work in that way but needs the migration files (sql or

Docker 1.12: Multiple replicas, single database

冷暖自知 提交于 2019-12-12 12:40:54
问题 With the introduction of the new 'swarm mode' with Docker 1.12, we've been trying to migrate our application on containers and make use of the swarm mode's orchestration & clusters. Our application requires some initial database scripts to be run for it to start. We're not packaging the database inside our dockerized application so that it could follow a stateless microservice architecture and multiple containers would eventually talk to a single (at the moment) database instance. While

Spring Boot: Hibernate and Flyway boot order

眉间皱痕 提交于 2019-12-12 07:17:09
问题 I have created Spring application. Pom xml is attached. It has a config like this (below) and some db/migration/V1__init.sql for Flyway db migration tool. It has hsqldb in-memory database and it is created after application is started. It is clean after creation. I want Hibernate to create a schema based on entity classes and then Flyway fills the tables. Now Flyway starts V1__init.sql before tables is created and throw an exception. How can I change this order or what solution can I do?

Flyway DB2 change delimiter NOT WORKING

孤街醉人 提交于 2019-12-12 05:09:39
问题 We use Flyway as a DB migration tool. Now we want to use it for executing some import statements on our database. In the data are some stored procedures and commands that contain the ";" character. So we wanted to change the delimiter in the sql script. In IBM Data studio I achieved this by following sql code: --#SET TERMINATOR @ insert into "CONTROL"."AP18_ADMIN_RIGHTS" ("REG_ID", "USERNAME") values(12,'testuser')@ --#SET TERMINATOR ; But when I tried to execute this code using flyway I got

Flyway for Existing PUBLIC schema

二次信任 提交于 2019-12-12 04:08:17
问题 @Configuration @ComponentScan("com.sammy") @EnableTransactionManagement public class DataSourceConfig { @Bean(destroyMethod = "shutdown") public DataSource dataSource(){ EmbeddedDatabaseBuilder databaseBuilder = new EmbeddedDatabaseBuilder(); databaseBuilder.setType(EmbeddedDatabaseType.H2); databaseBuilder.addScript("classpath:db/migration/V1__Create_Books_Table.sql"); databaseBuilder.addScript("classpath:db/migration/V2__Add_Books.sql"); return databaseBuilder.build(); } @Bean(name =

FlyWay: Why are schemas not created when setInitOnMigrate is set?

眉间皱痕 提交于 2019-12-12 02:00:46
问题 Scenario: Existing database with one schema, the transport schema. 2 migration files where version 1 is the initial / base version. Version 2 adds a table to the management schema (but does not create that schema, I want FlyWay to do that). Using FlyWay API (in Java application) //... flyway.setSchemas("transport", "management"); flyway.setInitVersion("1"); flyway.setInitOnMigrate(true); flyway.migrate(); migration version 2 fails because the management schema has not being created. This

Debug output when using flyways ant tasks

人盡茶涼 提交于 2019-12-11 20:34:32
问题 The command line documentation mentions an argument -x for debug output. However I cannot find anything in the ant task documentation. Is there a way to activate it there as well? 回答1: Use the standard ant -d switch to turn on the debug output. 来源: https://stackoverflow.com/questions/15634807/debug-output-when-using-flyways-ant-tasks

Mysql dump comments directives and simple comments

╄→尐↘猪︶ㄣ 提交于 2019-12-11 18:39:45
问题 We are planing to use Flyway to manage our migrations because it seams to be a great tool that could perfectly suit our needs. What we have today is MySQL databases for development, and mysql - oracle DB for production cycle. It seems impossible today with Flyway integrated with ant to deal with simple comments that are into mysqldump comments directives. It looks like this : /*!50003 CREATE*/ /*!50020 DEFINER=`root`@`localhost`*/ /*!50003 PROCEDURE `lockObject`( IN parTypeId INTEGER, IN