Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
MatrixDev authored Dec 18, 2018
1 parent e1129f3 commit 501f7ca
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,14 +112,14 @@ Returned value will be injected as-is to final SQL statement when copying/updati
Custom code can also be invoked before and after each migration:

```kotlin
@BeforeMigrationRule(version1 = 1, version2 = 2)
fun migrate_1_2_before(db: SupportSQLiteDatabase) {
@OnMigrationStartRule(version1 = 1, version2 = 2)
fun migrate_1_2_before(db: SupportSQLiteDatabase, version1: Int, version2: Int) {
val cursor = db.query("pragma table_info(Object1Dbo)")
assert(cursor.count == 1)
}

@AfterMigrationRule(version1 = 1, version2 = 2)
fun migrate_1_2_after(db: SupportSQLiteDatabase) {
@OnMigrationEndRule(version1 = 1, version2 = 2)
fun migrate_1_2_after(db: SupportSQLiteDatabase, version1: Int, version2: Int) {
val cursor = db.query("pragma table_info(Object1Dbo)")
assert(cursor.count == 3)
}
Expand Down

0 comments on commit 501f7ca

Please sign in to comment.