Skip to content

Instantly share code, notes, and snippets.

@takaki
Last active July 12, 2016 14:56
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save takaki/b2baae958a34970c813c434b1c253b2f to your computer and use it in GitHub Desktop.
Save takaki/b2baae958a34970c813c434b1c253b2f to your computer and use it in GitHub Desktop.
FlywayのサンプルをSQLiteでやってみる ref: http://qiita.com/takaki@github/items/d8831694eef6ce4da1e9
apply plugin: 'java'
apply plugin: "org.flywaydb.flyway"
buildscript {
repositories {
jcenter()
}
dependencies {
classpath group: "org.flywaydb", name: "flyway-gradle-plugin", version: "4.0.3"
classpath group: 'org.xerial', name: 'sqlite-jdbc', version: '3.8.11.2'
}
}
repositories {
mavenCentral()
}
flyway {
url = "jdbc:sqlite:./target/sample.db"
}
$ gradle flywayMigrate
$ sqlite3 target/sample.db '.schema PERSON'
CREATE TABLE PERSON (
ID int not null,
NAME varchar(100) not null
);
$ gradle flywayMigrate
$ sqlite3 target/sample.db 'select * from person'
1|Axel
2|Mr. Foo
3|Ms. Bar
create table PERSON (
ID int not null,
NAME varchar(100) not null
);
create table PERSON (
ID int not null,
NAME varchar(100) not null
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment