summaryrefslogtreecommitdiff
path: root/perl/Wallet/Schema.pm
diff options
context:
space:
mode:
authorRuss Allbery <rra@stanford.edu>2007-12-01 03:00:41 +0000
committerRuss Allbery <rra@stanford.edu>2007-12-01 03:00:41 +0000
commit6bd2cd0824130bd25918e2b709d0991003d5d392 (patch)
tree700010373d671a4db8f3aae716a8da32507b1c37 /perl/Wallet/Schema.pm
parent920e9456ee167a3edc023caa65d590d38fb90e22 (diff)
If we're using MySQL, force all the tables to InnoDB so that we get
transactions.
Diffstat (limited to 'perl/Wallet/Schema.pm')
-rw-r--r--perl/Wallet/Schema.pm2
1 files changed, 2 insertions, 0 deletions
diff --git a/perl/Wallet/Schema.pm b/perl/Wallet/Schema.pm
index e39cc81..5068d03 100644
--- a/perl/Wallet/Schema.pm
+++ b/perl/Wallet/Schema.pm
@@ -77,6 +77,8 @@ sub create {
if ($driver eq 'SQLite') {
$sql =~ s{auto_increment primary key}
{primary key autoincrement};
+ } elsif ($driver eq 'mysql' and $sql =~ /^\s*create\s+table\s/) {
+ $sql =~ s/;$/ engine=InnoDB;/;
}
$dbh->do ($sql, { RaiseError => 1, PrintError => 0 });
}