Everv0id
Everv0id

Reputation: 1980

flyway:migrate doesn't create tables

I have a java project with Flyway and PostgreSQL integration. There are two scripts in db/migration:

--V1__create_table_data_source.sql
CREATE TABLE data_source (
  id BIGSERIAL PRIMARY KEY,
  url TEXT,
  data_type TEXT
);
--V2__create_table_data.sql
CREATE TABLE data (
  id BIGSERIAL PRIMARY KEY,
  data TEXT,
  last_update TIMESTAMP,
  source_id BIGSERIAL REFERENCES data_source
);

I use maven script: mvn clean compile flyway:clean flyway:migrate, it says: BUILD SUCCESS. Then I go to psql and do \dt in my database, it says that No relations found. I cant understand the problem. Is that mean flyway doesn't create tables? Maybe I just use flyway wrong?

Upvotes: 3

Views: 5618

Answers (1)

Everv0id
Everv0id

Reputation: 1980

So, the problem was in <schemas> section in flyway plugin configuration. I've just removed <schemas> section completely, and now it works!

Upvotes: 4

Related Questions