Business-Cart-Generic
view release on metacpan or search on metacpan
lib/Business/Cart/Generic/Database/Create.pm view on Meta::CPAN
package Business::Cart::Generic::Database::Create;
use strict;
use warnings;
use DBIx::Admin::CreateTable;
use Moose;
use Try::Tiny;
extends 'Business::Cart::Generic::Base';
has creator =>
(
is => 'rw',
isa => 'DBIx::Admin::CreateTable',
required => 0,
);
has engine =>
(
is => 'rw',
isa => 'Str',
required => 0,
);
has time_option =>
(
is => 'rw',
isa => 'Str',
required => 0,
);
use namespace::autoclean;
our $VERSION = '0.85';
# -----------------------------------------------
sub BUILD
{
my($self) = @_;
$self -> creator
(
DBIx::Admin::CreateTable -> new
(
dbh => $self -> connector -> dbh,
verbose => 0,
)
);
$self -> engine
(
$self -> creator -> db_vendor =~ /(?:Mysql)/i ? 'engine=innodb' : ''
);
$self -> time_option
(
$self -> creator -> db_vendor =~ /(?:MySQL|Postgres)/i ? '(0) without time zone' : ''
);
} # End of BUILD.
# -----------------------------------------------
sub create_all_tables
{
my($self) = @_;
( run in 0.624 second using v1.01-cache-2.11-cpan-5b529ec07f3 )