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 e3fb456 commit 7254716
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")?.apply {
addField("fileId", Int::class.java)
setNullable("fileId", true)
addField("accessBlocked", 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 7254716

Please sign in to comment.