Skip to content

Commit

Permalink
The site's admin account isn't limited to 8 chars. Also, don't try to
Browse files Browse the repository at this point in the history
apply foreign key constraints while data is being inserted.
  • Loading branch information
jamiemccarthy committed Mar 10, 2004
1 parent dd27deb commit 66b9581
Showing 1 changed file with 9 additions and 3 deletions.
12 changes: 9 additions & 3 deletions bin/install-slashsite
Expand Up @@ -296,9 +296,7 @@ your Slash directories). [Y] ";


unless ($opts{'a'}) {
print "
Create a name for the site's admin account (8 characters
or less). [$owner] ";
print "Create a name for the site's admin account. [$owner] ";
chomp($username = <STDIN>);
$username ||= $owner;
} else {
Expand Down Expand Up @@ -382,6 +380,14 @@ while (<$dump>) {
}

close $dump;

# We start this whole process by turning off foreign key
# 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';

for my $cmd (@sql) {
next unless $cmd;
my $rows_affected = $dbh->do($cmd);
Expand Down

0 comments on commit 66b9581

Please sign in to comment.