From 8109f04963b9408f42a137934d8818f9a3b580b1 Mon Sep 17 00:00:00 2001 From: Brandon Eckenrode Date: Wed, 23 Nov 2016 23:52:25 -0500 Subject: [PATCH] Fix for #21 Fix for #21 --- export-laravel-5-migrations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/export-laravel-5-migrations.py b/export-laravel-5-migrations.py index d54a121..4946aac 100644 --- a/export-laravel-5-migrations.py +++ b/export-laravel-5-migrations.py @@ -146,7 +146,7 @@ def create_tree(table_schema): table_references = [] for key in tbl.foreignKeys: - if key.name != '': + if key.name != '' and tbl.name != key.referencedColumns[0].owner.name: table_references.append(key.referencedColumns[0].owner.name) tree[tbl.name] = table_references