Flyway ignoring sql files

Viewed 642

I'm using flyway plugin inside jenkins.

I have 3 sql files

  1. V1.0__1_C_OWNER.sql
  2. V1.1__C_USER_APLICACAO.SQL
  3. V1.2__C_DDL_DCL.SQL

Only the first is running by flyway

Jenkins output

11:34:23 Flyway Community Edition 5.1.4 by Boxfuse
11:34:23     
11:34:24 Database: jdbc:oracle:thin:@(DESCRIPTION =(ADDRESS = (PROTOCOL = TCP)(HOST = db1.domain)(PORT = 1523))(CONNECT_DATA = (SERVICE_NAME = develop))) (Oracle 12.1)
11:34:24 Successfully validated 1 migration (execution time 00:00.022s)
11:34:24 Current version of schema "U_FLYWAY": 1.0
11:34:24 Schema "U_FLYWAY" is up to date. No migration necessary.
11:34:24 Result is already [Sucess], not changing

Plugin config.

enter image description here

2 Answers

The default setting for sqlMigrationSuffixes is lowercase .sql..

The suffixes of files 2 & 3 are both uppercase: .SQL.

Either rename the files to use a lowercase suffix, or override the default by adding:

-sqlMigrationSuffixes=.sql,.SQL

to the Other command line arguments section in Jenkins.

  1. Never edit existing file. Always add a new file and Make sure newly added SQL file Version number is greater than the existing ones.

  2. If its a stored procedure make sure you include DROP PROCEDURE IF EXISTS [Procedure_name]; so this enables to delete the old procedure and update with new one.

Related