File tree Expand file tree Collapse file tree 1 file changed +6
-5
lines changed
lib/SQL/Translator/Producer Expand file tree Collapse file tree 1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -289,18 +289,19 @@ sub produce {
289289 join ( ' , ' , $index -> fields ) . " )" ;
290290 }
291291
292- my $drop_statement = $add_drop_table
293- ? qq[ DROP TABLE $table_name_ur ] : ' ' ;
294- my $create_statement = qq[ CREATE TABLE $table_name_ur (\n ] .
292+ my @statements ;
293+ push @statements , qq[ DROP TABLE $table_name_ur \n\n ] if $add_drop_table ;
294+ push @statements , qq[ CREATE TABLE $table_name_ur (\n ] .
295295 join ( " ,\n " ,
296296 map { " $_ " } @field_defs , @constraint_defs
297297 ).
298298 " \n )"
299299 ;
300300
301- $create_statement = join (" \n\n " , @comments ) . " \n\n " . $create_statement ;
301+ # prefix the first statement with the comments
302+ unshift @statements , join (" \n\n " , @comments ) . " \n\n " . shift ( @statements );
302303 push @output ,
303- $create_statement ,
304+ @statements ,
304305 @index_defs ,
305306 ;
306307 }
You can’t perform that action at this time.
0 commit comments