LoginSignup
3
2

More than 5 years have passed since last update.

Flyway で SQL ベースの Migration を Gradle から行う.

Posted at

以下は簡単なので SQLite ですが適宜 JDBC の classpath と url を変更.

build.gradle
apply plugin: 'flyway'

buildscript {
    repositories {
        mavenCentral()
    }
    dependencies {
        classpath 'org.flywaydb:flyway-gradle-plugin:3.1'
        classpath 'org.xerial:sqlite-jdbc:3.8.7'
    }
}

flyway {
    url = 'jdbc:sqlite:/path/to/sqlite/db/file'
    locations = ['filesystem:/path/to/migration/sql/files']
}
3
2
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
2