Skip to content

Commit

Permalink
enable legacy_alter_table for table renames in API 30+
Browse files Browse the repository at this point in the history
  • Loading branch information
RBusarow committed Aug 6, 2020
1 parent 76ba554 commit 1175616
Showing 1 changed file with 6 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,12 @@ class Migration(
createTableIndices(tableDiff.new)
}

val pendingTableRename = diff.changedTables.any { it.fieldsDiff.wasChanged || it.nameChanged }

if (pendingTableRename) {
execSql("PRAGMA legacy_alter_table=ON;")
}

for (tableDiff in diff.changedTables) {
val table1 = tableDiff.old
val table2 = tableDiff.new
Expand Down

0 comments on commit 1175616

Please # to comment.