File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -98,7 +98,7 @@ sub process_db {
9898 verbose(" \t LOADER-LOG.txt gone" );
9999 }
100100
101- verbose(" Finished with database '${DB} '" );
101+ verbose(" Finished with database '${DB} '" );
102102
103103 return ;
104104}
@@ -151,6 +151,11 @@ sub _process_table {
151151 $drop_table = $src ne $trg ;
152152 $populate_table = $drop_table ;
153153 }
154+ # Populate always
155+ elsif ($OPTIONS -> {force }) {
156+ $drop_table = 1;
157+ $populate_table = 1;
158+ }
154159 else {
155160 die ' You have not said how to compare these schemas. Check the help' ;
156161 }
@@ -274,6 +279,7 @@ sub _parse_options {
274279 directory=s
275280 database=s
276281 disable-foreign-keys
282+ force
277283 host=s
278284 no-dump
279285 no-views
@@ -354,6 +360,7 @@ sub _open_dbh {
354360 );
355361 my $dsn = " DBI:mysql:database=${db}${hostname}${port} " ;
356362 my $dbh = DBI-> connect ($dsn , $user , $password , {RaiseError => 1});
363+ $dbh -> do(" SET FOREIGN_KEY_CHECKS = 0" );
357364 return $dbh ;
358365}
359366
You can’t perform that action at this time.
0 commit comments