Skip to content

Commit

Permalink
Possible fix for #18
Browse files Browse the repository at this point in the history
Check if referencedColumns exists
  • Loading branch information
beckenrode committed Nov 24, 2016
1 parent 8109f04 commit 59d3766
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion export-laravel-5-migrations.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 59d3766

Please sign in to comment.