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 9140109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T09:28:23+00:00 2026-06-17T09:28:23+00:00

I have a project with two modules. Both modules use flyway for migration and

  • 0

I have a project with two modules. Both modules use flyway for migration and initial setup of the database. Both projects are independent. I also have a test in each module. Whenever I run both modules, or also only one test from one module the migration may not be executed.
Module one contains

  • a.b.c.account.persistence.jdbc.migrations.Vaccount_1__CreateStructure.java
    a.b.c.account.persistence.jdbc.migrations.Vaccount_2__CreateIndexOnName.sql
    …
    a.b.c.account.persistence.jdbc.migrations.Vaccount_5__AddDAOCreatedAndUpdated.sql

and JDBCAccountPersistenceServiceImpl with JDBCAccountPersistenceServiceImplTest.

Module two contains

  • a.b.c.authentication.persistence.jdbc.migrations.Vauth_1__CreateTableForPasswords.sql
    a.b.c.authentication.persistence.jdbc.JDBCAuthenticationPersistenceServiceImpl

and JDBCAuthenticationPersistenceServiceImplTest.

Both Impls share a parent class the calls in its init method:

//prepare db.
Flyway flyway = new Flyway();
flyway.setDataSource(getDataSource());
flyway.setLocations(getClass().getPackage().getName()+".migrations");
flyway.migrate();

Both tests work if started separately on clean db and on filled db. However, If I clean DB and run the tests from intellij with running JDBCAuthenticationPersistenceServiceImplTest first, the other test would fail:

org.postgresql.util.PSQLException: ERROR: relation "account" does not exist
  Position: 13
    at org.postgresql.core.v3.QueryExecutorImpl.receiveErrorResponse(QueryExecutorImpl.java:2103)

The schema_version would in this case contain only one line:

1 |              1 | auth.1  | CreateTableForPasswords | SQL  | Vauth_1__CreateTableForPasswords.sql | -1961897674 | another      | 2013-01-14 23:39:00.736033 |             18 | t

If i delete all tables manually the test would run again. If I run the test from console on clean db (maven) it also works.
What am I doing wrong?
could it be that auth.1 is considered higher version than account.1 and therefore account.1 patch isn’t executed?

  • 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-17T09:28:24+00:00Added an answer on June 17, 2026 at 9:28 am

    Three issues at hand here.

    1. You are missing a sqlMigrationPrefix like Vaccount_
    2. Flyway is overly permissive with versions and should reject account.1 as a valid version number
    3. The modules should probably have separate metadata tables
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two projects, both of which use CMake. Now I want to include
I have a project that uses two third party libraries, both of which make
I have two Django Projects where I use a lot of common models. Custom
I have a .NET 4.0 project with two modules that will communicate via WCF
I have small project consisting of one maven project and two maven modules. One
I am working on a Web application, I have its two Modules,both modules are
I have a small (very small) zend project that covers two modules, the admin
I have two websites running on the same server. Both use passenger and rvm.
I try to build my project, that have two .so files: libTheGame.so liblua.so Both
I have two modules in my installation. Both modules' controllers pass a variable called

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.