From 59d3766fe88b312d6dab46d73366c102c23bde13 Mon Sep 17 00:00:00 2001 From: Brandon Eckenrode Date: Thu, 24 Nov 2016 00:27:44 -0500 Subject: [PATCH] Possible fix for #18 Check if referencedColumns exists --- 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 4946aac..12abfb9 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 != '' and tbl.name != key.referencedColumns[0].owner.name: + if key.name != '' and tbl.name != key.referencedColumns[0].owner.name and hasattr(key, 'referencedColumns'): table_references.append(key.referencedColumns[0].owner.name) tree[tbl.name] = table_references