| 216 | raise ValueError(f"Cannot find migration {migration_name!r} in app {app_label!r}") |
| 217 | |
| 218 | async def _project_state( |
| 219 | self, applied: set[MigrationKey], *, upto: MigrationKey | None = None |
| 220 | ) -> State: |
| 221 | default_connections = { |
| 222 | label: config.get("default_connection", "default") |
| 223 | for label, config in self.loader.apps_config.items() |
| 224 | } |
| 225 | state = State(models={}, apps=StateApps(default_connections=default_connections)) |
| 226 | for key in self._full_plan(): |
| 227 | if key not in applied: |
| 228 | continue |
| 229 | if upto and key == upto: |
| 230 | break |
| 231 | migration = self.loader.graph.nodes[key] |
| 232 | if migration is None: |
| 233 | raise ValueError(f"Missing migration for {key}") |
| 234 | await migration.apply(state, dry_run=True, schema_editor=None) |
| 235 | return state |
| 236 | |
| 237 | async def _project_state_cache(self, applied: set[MigrationKey]) -> dict[MigrationKey, State]: |
| 238 | default_connections = { |