I ran into the same problem and found this post developer.apple.com/for…
I've updated the initializer to take a ModelContainer and add all needed Models to it.
```Swift
init(container: ModelContainer) {
I ran into the same problem and found this post https://developer.apple.com/forums/thread/759634
self.container = container
}
```
let schema = Schema([Model1.self, Model2.self])
let modelConfiguration = ModelConfiguration(schema: schema)
let container = try ModelContainer(for: Model1.self, Model2.self, configurations: modelConfiguration)
self.model1DB = Model1Database(container: container)
self.model2DB = Model2Database(container: container)
For your security, we need to re-authenticate you.
Click the link we sent to , or click here to sign in.
I ran into the same problem and found this post https://developer.apple.com/forums/thread/759634
I've updated the initializer to take a ModelContainer and add all needed Models to it.
```Swift
init(container: ModelContainer) {
self.container = container
}
```
```Swift
let schema = Schema([Model1.self, Model2.self])
let modelConfiguration = ModelConfiguration(schema: schema)
let container = try ModelContainer(for: Model1.self, Model2.self, configurations: modelConfiguration)
self.model1DB = Model1Database(container: container)
self.model2DB = Model2Database(container: container)
```