diff --git a/data.py b/data.py index e05b5bc..14454b1 100644 --- a/data.py +++ b/data.py @@ -1,3 +1,4 @@ +import datetime import faker import uuid @@ -27,7 +28,7 @@ number_of_fields = 1 excluded_tables = ["system_setting"] tables_to_fill = ["user"] -graph = False +graph = True fields = [ { diff --git a/src/populate.py b/src/populate.py index 07b0a7c..8feb9a0 100644 --- a/src/populate.py +++ b/src/populate.py @@ -318,15 +318,13 @@ def arrange_graph(self): The function arranges identified inheritance relations in a directed graph and orders them topologically. """ - task = self.job_progress.advance(self.identifying_relations) - graph = nx.DiGraph() - step = 60 / len(self.inheritance_relations) for table, inherited_tables in self.inheritance_relations.items(): if inherited_tables: for inherited_table in inherited_tables: - graph.add_edge(inherited_table, table) + if table != inherited_table: # Skip self-references + graph.add_edge(inherited_table, table) else: graph.add_node(table)