Skip to content

Commit e39246f

Browse files
committed
Update export-laravel-5-migrations.py
1 parent dd9d6fd commit e39246f

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

export-laravel-5-migrations.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -152,10 +152,11 @@ def export_schema(out, schema, is_main_schema):
152152
if fkey.name != '':
153153
if fkey.referencedColumns[0].owner.name in migration_tables:
154154
if first_foreign_created == 0:
155-
out.write('\n')
155+
out.write(" Schema::table('" + tbl.name + "', function (Blueprint $table) {\n")
156156
first_foreign_created = 1
157-
out.write(" $table->dropForeign(['" + fkey.columns[0].name + "']);\n")
157+
out.write(" $table->dropForeign(['" + fkey.columns[0].name + "']);\n")
158158
if first_foreign_created == 1:
159+
out.write(" });\n")
159160
out.write('\n')
160161

161162
for fkey, fval in foreign_keys.iteritems():
@@ -166,7 +167,6 @@ def export_schema(out, schema, is_main_schema):
166167
if item['table'] not in keyed_tables:
167168
keyed_tables.append(item['table'])
168169
if schema_table == 0:
169-
out.write('\n')
170170
out.write(" Schema::table('" + item['table'] + "', function (Blueprint $table) {\n")
171171
schema_table = 1
172172
out.write(" $table->dropForeign(['" + item['name'] + "']);\n")

0 commit comments

Comments
 (0)