Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8333957
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T03:11:34+00:00 2026-06-09T03:11:34+00:00

I make some experiments with flyway-maven-plugin. I’ve not an empty database, so I need

  • 0

I make some experiments with flyway-maven-plugin. I’ve not an empty database, so I need an initial ddl script. I follow the instructions in the flyway wiki:

I put the sql script, named V1__Base_Migration.sql, in src/main/resources/db/migration.

The configuration of flyway-maven-plugin looks like the following one:

<build>
    <plugins>
        <plugin>
            <groupId>com.googlecode.flyway</groupId>
            <artifactId>flyway-maven-plugin</artifactId>
            <version>1.7</version>
            <configuration>
                <driver>org.hsqldb.jdbcDriver</driver>
                <url>jdbc:hsqldb:hsql://localhost:9001/testdb</url>
                <user>SA</user>
                <password></password>
                <schemas>PUBLIC</schemas>
                <initialVersion>1</initialVersion>
                <initialDescription>Base Migration</initialDescription>
            </configuration>
        </plugin>
    </plugins>
</build>

When I call mvn install flyway:init on the cmd and look after the run in the database, I can find the version table of flyway but not the table, whose ddl is in the sql script.

When I have a look in the debug log of Maven, I cannot find any hint that the sql script was run.

[DEBUG]   Excluded: classworlds:classworlds:jar:1.1
[DEBUG] Configuring mojo com.googlecode.flyway:flyway-maven-plugin:1.7:init from   plugin realm ClassRealm[plugin>com.googlecode.flyway:flyway-maven-plugin:1.7, parent: sun.misc.Launcher$AppClassLoader@11799e7]
[DEBUG] Configuring mojo 'com.googlecode.flyway:flyway-maven-plugin:1.7:init' with include-project-dependencies configurator -->
[DEBUG]   (f) driver = org.hsqldb.jdbcDriver
[DEBUG]   (f) initialDescription = Base Migration
[DEBUG]   (f) initialVersion = 1
[DEBUG]   (f) schemas = PUBLIC
[DEBUG]   (f) settings = org.apache.maven.execution.SettingsAdapter@1aa246e
[DEBUG]   (f) url = jdbc:hsqldb:hsql://localhost:9001/testdb
[DEBUG]   (f) user = SA
[DEBUG] -- end configuration --
[DEBUG] Database: HSQL Database Engine
[INFO] Hsql does not support locking. No concurrent migration supported.
[DEBUG] Schema: PUBLIC
[INFO] Creating Metadata table: schema_version (Schema: PUBLIC)
[DEBUG] Found statement at line 17: CREATE TABLE PUBLIC.schema_version (
version VARCHAR(20) PRIMARY KEY,
description VARCHAR(100),
type VARCHAR(10) NOT NULL,
script VARCHAR(200) NOT NULL,
checksum INT,
installed_by VARCHAR(30) NOT NULL,
installed_on TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
execution_time INT,
state VARCHAR(15) NOT NULL,
current_version BIT NOT NULL,
CONSTRAINT PUBLIC.schema_version_script_unique UNIQUE (script)
);
[DEBUG] Found statement at line 30: CREATE INDEX    PUBLIC.schema_version_current_version_index ON PUBLIC.schema_version (current_version);
[DEBUG] Executing SQL: CREATE TABLE PUBLIC.schema_version (
version VARCHAR(20) PRIMARY KEY,
description VARCHAR(100),
type VARCHAR(10) NOT NULL,
script VARCHAR(200) NOT NULL,
checksum INT,
installed_by VARCHAR(30) NOT NULL,
installed_on TIMESTAMP DEFAULT CURRENT_TIMESTAMP,
execution_time INT,
state VARCHAR(15) NOT NULL,
current_version BIT NOT NULL,
CONSTRAINT PUBLIC.schema_version_script_unique UNIQUE (script)
)
[DEBUG] Executing SQL: CREATE INDEX PUBLIC.schema_version_current_version_index ON PUBLIC.schema_version (current_version)
[DEBUG] Metadata table created: schema_version (Schema: PUBLIC)

Do I do anyhing wrong? It would be cool, if somebody can give me a hint, what I’m doing wrong.

You can find the whole Maven test project in [github] (https://github.com/skosmalla/flyway-maven-test)

Best regards,

Sandra

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-09T03:11:35+00:00Added an answer on June 9, 2026 at 3:11 am

    flyway:init is useful when you have existing tables in your production schema (say ABC and XYZ) and you decide to start using Flyway to manage your DB’s lifecycle.

    You can them dump the structure of the production schema in an sql script, say V0_9__Prod.sql to execute locally. This way you can align your dev DB with the current structure from PROD. As you add functionality, you can then add additional migrations like V1__Base_Migration.sql.

    When deploying to PROD though, you do not want V0_9__Prod.sql to run again.
    To avoid this, you can flyway:init the PROD schema with 0.9.

    When it runs the migrations it will then skip V0_9__Prod.sql and move straight to V1__Base_Migration.sql.

    If this situation does not apply to you, you can simply run flyway:migrate. No need for flyway:init first.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I need make some action (dump statistical data) before the Dart program ends. The
I'm trying to make some keen experiments about android event handler... Let say.., I
We need to set up a page to make some highly confidential documents (PDF,
While I make some (java) code, i feel the need to experiment and change
Trying to make some experiments with Spring MVC and Spring Security: @Controller @RequestMapping(/auth) public
I already make some search on the forum and on google about initializing and
I am trying to make some project in which i want a text box
I was attempting to make some expression templates as an answer to this question
I am trying to make some edits to a site for a client of
I'm trying to make some input fields that I would like to work like

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.