Skip to content

Commit

Permalink
remove setting deps (#14)
Browse files Browse the repository at this point in the history
  • Loading branch information
ronenlu authored Jan 24, 2024
1 parent 06babf0 commit d44fbe7
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -119,13 +119,17 @@ def __init__(self, connection, replace_migrations=False, load=False):
super().__init__(connection, replace_migrations, load)

def build_graph(self):
self.disk_migrations = get_migrations()
self.load_disk()
manual_migrations = get_migrations()
self.disk_migrations = {**self.disk_migrations, **manual_migrations}
self.applied_migrations = {}
self.unmigrated_apps = set()
self.migrated_apps = set()
self.graph = MigrationGraph()
for key, migration in self.disk_migrations.items():
self.graph.add_node(key, migration)
for key, migration in self.disk_migrations.items():
self.add_internal_dependencies(key, migration)
for key, migration in self.disk_migrations.items():
self.add_external_dependencies(key, migration)
self.graph.validate_consistency()
self.graph.ensure_not_cyclic()

Expand Down
6 changes: 5 additions & 1 deletion atlas_provider_django/management/commands/migrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,9 @@ def get_migrations(apps=None):
for app_label, app_migrations in changes.items():
if apps and app_label not in apps:
continue
migrations[(app_label, app_migrations[0].name)] = app_migrations[0]
migration = app_migrations[0]
for dep in migration.dependencies:
if dep[0] == "__setting__":
migration.dependencies.remove(dep)
migrations[(app_label, migration.name)] = migration
return migrations

0 comments on commit d44fbe7

Please sign in to comment.