Skip to content

Commit

Permalink
feat(PublicShareMigration): Migrate ShareLink model
Browse files Browse the repository at this point in the history
  • Loading branch information
FabianDevel committed Oct 1, 2024
1 parent e44a6c9 commit fc9a55d
Showing 1 changed file with 14 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -349,6 +349,19 @@ class FileMigration : RealmMigration {

oldVersionTemp++
}

// Migrated to version 8
// - Add new field `fileId` in ShareLink table
// - Add new field `accessBlocked` in ShareLink table
if (oldVersionTemp == 7L) {
schema.get(ShareLink::class.java.simpleName)?.apply {
addField(ShareLink::fileId.name, Int::class.java)
setNullable(ShareLink::fileId.name, true)
addField(ShareLink::accessBlocked.name, Boolean::class.java, FieldAttribute.REQUIRED)
}

oldVersionTemp++
}
}

override fun equals(other: Any?): Boolean {
Expand Down Expand Up @@ -376,7 +389,7 @@ class FileMigration : RealmMigration {
}

companion object {
const val dbVersion = 7L // Must be bumped when the schema changes
const val dbVersion = 8L // Must be bumped when the schema changes
const val LOGOUT_CURRENT_USER_TAG = "logout_current_user_tag"
}
}

0 comments on commit fc9a55d

Please sign in to comment.