Fix SwiftData migration crash on schema upgrades
Add = false/true defaults to all non-optional Bool properties so SwiftData's lightweight migration knows what value to assign existing rows. Replace try! ModelContainer with crash-safe do-catch that resets the store on migration failure instead of crashing. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -8,7 +8,7 @@ final class Dish {
|
||||
var descriptionText: String?
|
||||
var tagIds: [UUID]
|
||||
var createdAt: Date
|
||||
var isPriority: Bool
|
||||
var isPriority: Bool = false
|
||||
|
||||
init(
|
||||
id: UUID = UUID(),
|
||||
|
||||
Reference in New Issue
Block a user