Permalink
Browse files

allow the user to speficy engine (InnoDB, for example)

  • Loading branch information...
1 parent 2f25e17 commit 1b15293537022f0a5f65c6f7de8e8a3c71a3eb35 Jeremy Zawodny committed Sep 22, 2011
Showing with 3 additions and 1 deletion.
  1. +3 −1 lib/TicketServer.pm
View
@@ -18,6 +18,7 @@ sub new {
_dsn => $args->{dsn},
_user => $args->{user},
_password => $args->{password},
+ _engine => $args->{engine} || 'MyISAM',
};
bless $self, $class;
@@ -112,11 +113,12 @@ sub create_sequence {
$name =~ s{\W}{}g;
$start_value =~ s{\D}{}g;
+ my $engine = $self->{_engine};
my $sql = <<SQL;
CREATE TABLE IF NOT EXISTS $name (
id bigint(20) UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
stub char(1) NOT NULL UNIQUE DEFAULT ''
-) ENGINE=MyISAM AUTO_INCREMENT=$start_value CHARACTER SET='UTF8'
+) ENGINE=$engine AUTO_INCREMENT=$start_value CHARACTER SET='UTF8'
SQL
my $created = 0;

0 comments on commit 1b15293

Please sign in to comment.