Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove setting deps #14

Merged
merged 1 commit into from
Jan 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading