You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Migration succeeds when app is offline but when becomes online, local objects are replaced with iCloud objects due to which local objects lose data
#271
Open
mibrahim025 opened this issue
Mar 15, 2023
· 1 comment
I had recipient and phonenumber objects like these.
@objc class Recipient: Object { @persisted(primaryKey: true) var rec_id = "" @persisted var firstName = "" @persisted var lastName = "" @persisted var phoneNumbersList = List() @persisted var email = "" @persisted var isDeleted = false // IceCream requirement
}
@objc class PhoneNumber: Object { @persisted(primaryKey: true) var id = "" @persisted var number = "" @persisted var isDeleted = false // IceCream requirement
}
I changed the schema to this. i.e. removed the phoneNumberList property and added phoneNumber as string only.
@objc public class Recipient: Object { @persisted(primaryKey: true) var rec_id = "" @persisted var firstName = "" @persisted var lastName = "" @persisted var phoneNumber = "" @persisted var email = "" @persisted public var isDeleted = false // IceCream requirement
}
Old records on icloud have phonenumberList property populated and phoneNumber property is nil.
Now in the new version of the app, i have done migration correctly and it works but when the app is offline. When it becomes online, the migrated records again are replaced with the fetched records from icloud whose phoneNumber property is nil and my app starts missing phoneNumbers. How can i solve this?
The text was updated successfully, but these errors were encountered:
mibrahim025
changed the title
"Migration succeeds when app is offline but when becomes online, local objects are replaced with iCloud objects due to which local objects loss data
Migration succeeds when app is offline but when becomes online, local objects are replaced with iCloud objects due to which local objects loss data
Mar 15, 2023
mibrahim025
changed the title
Migration succeeds when app is offline but when becomes online, local objects are replaced with iCloud objects due to which local objects loss data
Migration succeeds when app is offline but when becomes online, local objects are replaced with iCloud objects due to which local objects lose data
Mar 15, 2023
I had recipient and phonenumber objects like these.
@objc class Recipient: Object {
@persisted(primaryKey: true) var rec_id = ""
@persisted var firstName = ""
@persisted var lastName = ""
@persisted var phoneNumbersList = List()
@persisted var email = ""
@persisted var isDeleted = false // IceCream requirement
}
@objc class PhoneNumber: Object {
@persisted(primaryKey: true) var id = ""
@persisted var number = ""
@persisted var isDeleted = false // IceCream requirement
}
I changed the schema to this. i.e. removed the phoneNumberList property and added phoneNumber as string only.
@objc public class Recipient: Object {
@persisted(primaryKey: true) var rec_id = ""
@persisted var firstName = ""
@persisted var lastName = ""
@persisted var phoneNumber = ""
@persisted var email = ""
@persisted public var isDeleted = false // IceCream requirement
}
Old records on icloud have phonenumberList property populated and phoneNumber property is nil.
Now in the new version of the app, i have done migration correctly and it works but when the app is offline. When it becomes online, the migrated records again are replaced with the fetched records from icloud whose phoneNumber property is nil and my app starts missing phoneNumbers. How can i solve this?
The text was updated successfully, but these errors were encountered: