@@ -55,14 +55,17 @@ protected function execute(InputInterface $input, OutputInterface $output)
55
55
$ this ->callPhing ('sql ' , array ('propel.packageObjectModel ' => false ));
56
56
$ filesystem = new Filesystem ();
57
57
$ basePath = $ this ->application ->getKernel ()->getRootDir (). DIRECTORY_SEPARATOR . 'propel ' . DIRECTORY_SEPARATOR . 'sql ' ;
58
+ $ sqlMap = file_get_contents ($ basePath . DIRECTORY_SEPARATOR . 'sqldb.map ' );
58
59
foreach ($ this ->tempSchemas as $ schemaFile => $ schemaDetails ) {
59
60
$ sqlFile = str_replace ('.xml ' , '.sql ' , $ schemaFile );
60
- $ targetFileName = $ basePath . DIRECTORY_SEPARATOR . $ schemaDetails ['bundle ' ] . '- ' . str_replace ('.xml ' , '.sql ' , $ schemaDetails ['basename ' ]);
61
- $ filesystem ->remove ($ targetFileName );
62
- $ filesystem ->rename ($ basePath . DIRECTORY_SEPARATOR . $ sqlFile , $ targetFileName );
63
- $ output ->writeln (sprintf ('Wrote SQL file for bundle "<info>%s</info>" in "<info>%s</info>" ' , $ schemaDetails ['bundle ' ], $ targetFileName ));
64
-
61
+ $ targetSqlFile = $ schemaDetails ['bundle ' ] . '- ' . str_replace ('.xml ' , '.sql ' , $ schemaDetails ['basename ' ]);
62
+ $ targetSqlFilePath = $ basePath . DIRECTORY_SEPARATOR . $ targetSqlFile ;
63
+ $ sqlMap = str_replace ($ sqlFile , $ targetSqlFile , $ sqlMap );
64
+ $ filesystem ->remove ($ targetSqlFilePath );
65
+ $ filesystem ->rename ($ basePath . DIRECTORY_SEPARATOR . $ sqlFile , $ targetSqlFilePath );
66
+ $ output ->writeln (sprintf ('Wrote SQL file for bundle "<info>%s</info>" in "<info>%s</info>" ' , $ schemaDetails ['bundle ' ], $ targetSqlFilePath ));
65
67
}
68
+ file_put_contents ($ basePath . DIRECTORY_SEPARATOR . 'sqldb.map ' , $ sqlMap );
66
69
}
67
70
68
71
}
0 commit comments