Skip to content

Commit

Permalink
Wait until the very end of the SQL before restoring foreign key checks.
Browse files Browse the repository at this point in the history
  • Loading branch information
jamiemccarthy committed Apr 3, 2004
1 parent c9ab1ef commit d2c2078
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions bin/install-slashsite
Expand Up @@ -385,8 +385,10 @@ close $dump;
# constraints -- since we will be adding data in an order
# not guaranteed to match those constraints. When all
# the data is inserted, we can turn them back on.
unshift @sql, 'SET FOREIGN_KEY_CHECKS = 0';
push @sql, 'SET FOREIGN_KEY_CHECKS = 1';

$dbh->do("SET FOREIGN_KEY_CHECKS = 0");

# Now process all the SQL.

for my $cmd (@sql) {
next unless $cmd;
Expand Down Expand Up @@ -459,6 +461,8 @@ if ($opts{'i'}) {
$include = '';
}

$dbh->do("SET FOREIGN_KEY_CHECKS = 1");

# Now, lets update slash.sites
my $sites = gensym();
if (open($sites, "< $SLASH_PREFIX/slash.sites\0")) {
Expand Down

0 comments on commit d2c2078

Please sign in to comment.