use Catalyst qw/
- ConfigLoader
+ +CookBook::Plugin::ConfigLoader
Static::Simple
'is_auto_increment' => 1,
'extras' => { 'unsigned' => 1 },
},
- "rid" => { 'data_type' => "CHAR", 'default_value' => "", 'is_nullable' => 0, 'size' => 32, },
- "title" => { 'data_type' => "VARCHAR", 'default_value' => "", 'is_nullable' => 0, 'size' => 250, },
- "published" => { 'data_type' => "ENUM", 'default_value' => "n", 'is_nullable' => 0, 'size' => 1, },
- "deleted" => { 'data_type' => "ENUM", 'default_value' => "n", 'is_nullable' => 0, 'size' => 1, },
- "locked" => { 'data_type' => "ENUM", 'default_value' => "n", 'is_nullable' => 0, 'size' => 1, },
- "preface" => { 'data_type' => "TEXT", 'default_value' => "", 'is_nullable' => 1, 'size' => 65535, },
- "instructions" => { 'data_type' => "TEXT", 'default_value' => "", 'is_nullable' => 0, 'size' => 65535, },
- "yield_amount" => { 'data_type' => "FLOAT", 'default_value' => 0, 'is_nullable' => 0, 'size' => 10, 'extras' => { 'unsigned' => 1 }, },
- "yield_amount_offset" => { 'data_type' => "FLOAT", 'default_value' => undef, 'is_nullable' => 1, 'size' => 10, 'extras' => { 'unsigned' => 1 }, },
- "yield_type_id" => { 'data_type' => "INT", 'default_value' => undef, 'is_nullable' => 1, 'size' => 10, 'extras' => { 'unsigned' => 1 }, },
- "prep_time" => { 'data_type' => "TIME", 'default_value' => undef, 'is_nullable' => 1, 'size' => 8, },
- "date_created" => { 'data_type' => "DATETIME", 'default_value' => "", 'is_nullable' => 0, 'size' => 19, },
- "user_created" => { 'data_type' => "INT", 'default_value' => 0, 'is_nullable' => 0, 'size' => 10, 'extras' => { 'unsigned' => 1 }, },
- "date_changed" => { 'data_type' => "DATETIME", 'default_value' => "", 'is_nullable' => 0, 'size' => 19, },
- "user_changed" => { 'data_type' => "INT", 'default_value' => 0, 'is_nullable' => 0, 'size' => 10, 'extras' => { 'unsigned' => 1 }, },
+ "rid" => { 'data_type' => "CHAR", 'default_value' => "", 'is_nullable' => 0, 'size' => 32, },
+ "title" => { 'data_type' => "VARCHAR", 'default_value' => "", 'is_nullable' => 0, 'size' => 250, },
+ "published" => { 'data_type' => "ENUM", 'default_value' => "n", 'is_nullable' => 0, 'size' => 1, },
+ "deleted" => { 'data_type' => "ENUM", 'default_value' => "n", 'is_nullable' => 0, 'size' => 1, },
+ "locked" => { 'data_type' => "ENUM", 'default_value' => "n", 'is_nullable' => 0, 'size' => 1, },
+ "preface" => { 'data_type' => "TEXT", 'default_value' => "", 'is_nullable' => 1, 'size' => 65535, },
+ "instructions" => { 'data_type' => "TEXT", 'default_value' => "", 'is_nullable' => 0, 'size' => 65535, },
+ "yield_amount" => { 'data_type' => "FLOAT", 'default_value' => 0, 'is_nullable' => 0, 'size' => 10, 'extras' => { 'unsigned' => 1 }, },
+ "yield_amount_offset" =>
+ { 'data_type' => "FLOAT", 'default_value' => undef, 'is_nullable' => 1, 'size' => 10, 'extras' => { 'unsigned' => 1 }, },
+ "yield_type_id" =>
+ { 'data_type' => "INT", 'default_value' => undef, 'is_nullable' => 1, 'size' => 10, 'extras' => { 'unsigned' => 1 }, },
+ "prep_time" => { 'data_type' => "TIME", 'default_value' => undef, 'is_nullable' => 1, 'size' => 8, },
+ "date_created" => { 'data_type' => "DATETIME", 'default_value' => "", 'is_nullable' => 0, 'size' => 19, },
+ "user_created" => { 'data_type' => "INT", 'default_value' => 0, 'is_nullable' => 0, 'size' => 10, 'extras' => { 'unsigned' => 1 }, },
+ "date_changed" => { 'data_type' => "DATETIME", 'default_value' => "", 'is_nullable' => 0, 'size' => 19, },
+ "user_changed" => { 'data_type' => "INT", 'default_value' => 0, 'is_nullable' => 0, 'size' => 10, 'extras' => { 'unsigned' => 1 }, },
);
__PACKAGE__->set_primary_key("recipe_id");
-__PACKAGE__->add_unique_constraint("rid", ["rid"]);
+__PACKAGE__->add_unique_constraint( "rid", ["rid"] );
__PACKAGE__->might_have( 'create_user' => 'CookBook::Db::Users', { 'foreign.user_id' => 'self.user_created' } );
__PACKAGE__->might_have( 'change_user' => 'CookBook::Db::Users', { 'foreign.user_id' => 'self.user_changed' } );
use CookBook::Common;
use base qw/DBIx::Class/;
-__PACKAGE__->load_components(qw/
- Core
-/);
+__PACKAGE__->load_components(
+ qw/
+ Core
+ /
+);
__PACKAGE__->table('session');
__PACKAGE__->add_columns(qw/id session_data expires/);
__PACKAGE__->set_primary_key('id');
-
1;
'DEBUG' => 1,
);
+#---------------------------------------------------------------------------
+
=head2 finalize_config
This method is called after the config file is loaded. It can be
$c->SUPER::finalize_config();
+ $c->config->{'debug_level'} = to_int( $c->config->{'debug_level'} ) ? to_int( $c->config->{'debug_level'} ) : 0;
+
# Vorgabe-View festlegen (kann mit $c->stash->{'current_view_instance'} oder $c->stash->{'current_view'} ueberschrieben werden.)
$c->config()->{'default_view'} = 'TT' unless $c->config()->{'default_view'};
} ## end sub finalize_config
+#---------------------------------------------------------------------------
+
1;
+#---------------------------------------------------------------------------
+
__PACKAGE__->load_classes;
-
# Created by DBIx::Class::Schema::Loader v0.04002 @ 2007-08-09 16:13:40
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:K8bZ7fKZDMRmA4VFZOZxlw
-
# You can replace this text with custom content, and it will be preserved on regeneration
1;
__PACKAGE__->load_components("Core");
__PACKAGE__->table("authors");
__PACKAGE__->add_columns(
- "author_id",
- { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
- "user_id",
- { data_type => "INT", default_value => undef, is_nullable => 1, size => 10 },
- "old_author_id",
- { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 },
- "author_name",
- { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 100 },
- "date_created",
- { data_type => "DATETIME", default_value => "", is_nullable => 0, size => 19 },
+ "author_id", { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
+ "user_id", { data_type => "INT", default_value => undef, is_nullable => 1, size => 10 },
+ "old_author_id", { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 },
+ "author_name", { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 100 },
+ "date_created", { data_type => "DATETIME", default_value => "", is_nullable => 0, size => 19 },
);
__PACKAGE__->set_primary_key("author_id");
-__PACKAGE__->add_unique_constraint("author_name", ["author_name"]);
-
+__PACKAGE__->add_unique_constraint( "author_name", ["author_name"] );
# Created by DBIx::Class::Schema::Loader v0.04002 @ 2007-08-09 16:13:40
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:/TukBw4LW+WnFPWauqg4pQ
-
# You can replace this text with custom content, and it will be preserved on regeneration
1;
__PACKAGE__->load_components("Core");
__PACKAGE__->table("recipe_authors");
__PACKAGE__->add_columns(
- "recipe_author_id",
- { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
- "recipe_id",
- { data_type => "INT", default_value => "", is_nullable => 0, size => 10 },
- "author_id",
- { data_type => "INT", default_value => "", is_nullable => 0, size => 10 },
- "order_index",
- { data_type => "INT", default_value => "", is_nullable => 0, size => 10 },
- "date_created",
- { data_type => "DATETIME", default_value => "", is_nullable => 0, size => 19 },
+ "recipe_author_id", { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
+ "recipe_id", { data_type => "INT", default_value => "", is_nullable => 0, size => 10 },
+ "author_id", { data_type => "INT", default_value => "", is_nullable => 0, size => 10 },
+ "order_index", { data_type => "INT", default_value => "", is_nullable => 0, size => 10 },
+ "date_created", { data_type => "DATETIME", default_value => "", is_nullable => 0, size => 19 },
);
__PACKAGE__->set_primary_key("recipe_author_id");
-
# Created by DBIx::Class::Schema::Loader v0.04002 @ 2007-08-09 16:13:40
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:KFDI7zAqfecL+bbLpF1nNw
-
# You can replace this text with custom content, and it will be preserved on regeneration
1;
__PACKAGE__->load_components("Core");
__PACKAGE__->table("recipes");
__PACKAGE__->add_columns(
- "recipe_id",
- { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
- "old_recipe_id",
- { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 },
- "rid",
- { data_type => "CHAR", default_value => "", is_nullable => 0, size => 32 },
- "title",
- { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 250 },
- "published",
- { data_type => "ENUM", default_value => "n", is_nullable => 0, size => 1 },
- "deleted",
- { data_type => "ENUM", default_value => "", is_nullable => 0, size => 1 },
- "locked",
- { data_type => "ENUM", default_value => "n", is_nullable => 0, size => 1 },
- "preface",
- {
- data_type => "TEXT",
- default_value => undef,
- is_nullable => 1,
- size => 65535,
- },
- "instructions",
- { data_type => "TEXT", default_value => "", is_nullable => 0, size => 65535 },
- "yield_amount",
- { data_type => "FLOAT", default_value => 0, is_nullable => 0, size => 32 },
- "yield_amount_offset",
- { data_type => "FLOAT", default_value => undef, is_nullable => 1, size => 32 },
- "yield_type_id",
- { data_type => "INT", default_value => undef, is_nullable => 1, size => 10 },
- "prep_time",
- { data_type => "TIME", default_value => undef, is_nullable => 1, size => 8 },
- "date_created",
- { data_type => "DATETIME", default_value => "", is_nullable => 0, size => 19 },
- "user_created",
- { data_type => "INT", default_value => "", is_nullable => 0, size => 10 },
- "date_changed",
- { data_type => "DATETIME", default_value => "", is_nullable => 0, size => 19 },
- "user_changed",
- { data_type => "INT", default_value => "", is_nullable => 0, size => 10 },
+ "recipe_id",
+ { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
+ "old_recipe_id",
+ { data_type => "INT", default_value => undef, is_nullable => 1, size => 11 },
+ "rid",
+ { data_type => "CHAR", default_value => "", is_nullable => 0, size => 32 },
+ "title",
+ { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 250 },
+ "published",
+ { data_type => "ENUM", default_value => "n", is_nullable => 0, size => 1 },
+ "deleted",
+ { data_type => "ENUM", default_value => "", is_nullable => 0, size => 1 },
+ "locked",
+ { data_type => "ENUM", default_value => "n", is_nullable => 0, size => 1 },
+ "preface",
+ { data_type => "TEXT",
+ default_value => undef,
+ is_nullable => 1,
+ size => 65535,
+ },
+ "instructions",
+ { data_type => "TEXT", default_value => "", is_nullable => 0, size => 65535 },
+ "yield_amount",
+ { data_type => "FLOAT", default_value => 0, is_nullable => 0, size => 32 },
+ "yield_amount_offset",
+ { data_type => "FLOAT", default_value => undef, is_nullable => 1, size => 32 },
+ "yield_type_id",
+ { data_type => "INT", default_value => undef, is_nullable => 1, size => 10 },
+ "prep_time",
+ { data_type => "TIME", default_value => undef, is_nullable => 1, size => 8 },
+ "date_created",
+ { data_type => "DATETIME", default_value => "", is_nullable => 0, size => 19 },
+ "user_created",
+ { data_type => "INT", default_value => "", is_nullable => 0, size => 10 },
+ "date_changed",
+ { data_type => "DATETIME", default_value => "", is_nullable => 0, size => 19 },
+ "user_changed",
+ { data_type => "INT", default_value => "", is_nullable => 0, size => 10 },
);
__PACKAGE__->set_primary_key("recipe_id");
-__PACKAGE__->add_unique_constraint("rid", ["rid"]);
-
+__PACKAGE__->add_unique_constraint( "rid", ["rid"] );
# Created by DBIx::Class::Schema::Loader v0.04002 @ 2007-08-09 16:13:40
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:pKlDxFw7PBwJQ+h8Z8FxLQ
-
# You can replace this text with custom content, and it will be preserved on regeneration
1;
__PACKAGE__->load_components("Core");
__PACKAGE__->table("session");
__PACKAGE__->add_columns(
- "id",
- { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 72 },
- "session_data",
- { data_type => "TEXT", default_value => "", is_nullable => 0, size => 65535 },
- "expires",
- { data_type => "INT", default_value => "", is_nullable => 0, size => 10 },
+ "id", { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 72 },
+ "session_data", { data_type => "TEXT", default_value => "", is_nullable => 0, size => 65535 },
+ "expires", { data_type => "INT", default_value => "", is_nullable => 0, size => 10 },
);
__PACKAGE__->set_primary_key("id");
-
# Created by DBIx::Class::Schema::Loader v0.04002 @ 2007-08-09 16:13:40
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:SEGt7AaZSpdxN24W2qkkFg
-
# You can replace this text with custom content, and it will be preserved on regeneration
1;
__PACKAGE__->load_components("Core");
__PACKAGE__->table("session_log");
__PACKAGE__->add_columns(
- "session_log_id",
- { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
- "user_id",
- { data_type => "INT", default_value => "", is_nullable => 0, size => 10 },
- "login_time",
- { data_type => "DATETIME", default_value => "", is_nullable => 0, size => 19 },
- "logout_time",
- {
- data_type => "DATETIME",
- default_value => undef,
- is_nullable => 1,
- size => 19,
- },
- "logout_reason",
- { data_type => "ENUM", default_value => undef, is_nullable => 1, size => 9 },
- "session_id",
- {
- data_type => "VARCHAR",
- default_value => undef,
- is_nullable => 1,
- size => 72,
- },
- "login",
- { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 50 },
- "user_name",
- { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 110 },
- "client_ip",
- {
- data_type => "VARCHAR",
- default_value => undef,
- is_nullable => 1,
- size => 20,
- },
- "client_host",
- {
- data_type => "VARCHAR",
- default_value => undef,
- is_nullable => 1,
- size => 200,
- },
- "user_agent",
- {
- data_type => "VARCHAR",
- default_value => undef,
- is_nullable => 1,
- size => 250,
- },
- "server",
- {
- data_type => "VARCHAR",
- default_value => undef,
- is_nullable => 1,
- size => 100,
- },
+ "session_log_id",
+ { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
+ "user_id",
+ { data_type => "INT", default_value => "", is_nullable => 0, size => 10 },
+ "login_time",
+ { data_type => "DATETIME", default_value => "", is_nullable => 0, size => 19 },
+ "logout_time",
+ { data_type => "DATETIME",
+ default_value => undef,
+ is_nullable => 1,
+ size => 19,
+ },
+ "logout_reason",
+ { data_type => "ENUM", default_value => undef, is_nullable => 1, size => 9 },
+ "session_id",
+ { data_type => "VARCHAR",
+ default_value => undef,
+ is_nullable => 1,
+ size => 72,
+ },
+ "login",
+ { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 50 },
+ "user_name",
+ { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 110 },
+ "client_ip",
+ { data_type => "VARCHAR",
+ default_value => undef,
+ is_nullable => 1,
+ size => 20,
+ },
+ "client_host",
+ { data_type => "VARCHAR",
+ default_value => undef,
+ is_nullable => 1,
+ size => 200,
+ },
+ "user_agent",
+ { data_type => "VARCHAR",
+ default_value => undef,
+ is_nullable => 1,
+ size => 250,
+ },
+ "server",
+ { data_type => "VARCHAR",
+ default_value => undef,
+ is_nullable => 1,
+ size => 100,
+ },
);
__PACKAGE__->set_primary_key("session_log_id");
-
# Created by DBIx::Class::Schema::Loader v0.04002 @ 2007-08-09 16:13:40
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:RmQzAMVSZmvYuFzIczRQ2Q
-
# You can replace this text with custom content, and it will be preserved on regeneration
1;
__PACKAGE__->load_components("Core");
__PACKAGE__->table("users");
__PACKAGE__->add_columns(
- "user_id",
- { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
- "login",
- { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 50 },
- "vorname",
- { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 100 },
- "nachname",
- { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 100 },
- "password",
- { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 250 },
- "date_created",
- { data_type => "DATETIME", default_value => "", is_nullable => 0, size => 19 },
- "date_changed",
- { data_type => "DATETIME", default_value => "", is_nullable => 0, size => 19 },
- "email",
- { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 250 },
- "deleted",
- { data_type => "ENUM", default_value => "n", is_nullable => 0, size => 1 },
- "enabled",
- { data_type => "ENUM", default_value => "y", is_nullable => 0, size => 1 },
- "admin_status",
- { data_type => "ENUM", default_value => "n", is_nullable => 0, size => 1 },
- "comments",
- { data_type => "TEXT", default_value => "", is_nullable => 0, size => 65535 },
+ "user_id", { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
+ "login", { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 50 },
+ "vorname", { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 100 },
+ "nachname", { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 100 },
+ "password", { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 250 },
+ "date_created", { data_type => "DATETIME", default_value => "", is_nullable => 0, size => 19 },
+ "date_changed", { data_type => "DATETIME", default_value => "", is_nullable => 0, size => 19 },
+ "email", { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 250 },
+ "deleted", { data_type => "ENUM", default_value => "n", is_nullable => 0, size => 1 },
+ "enabled", { data_type => "ENUM", default_value => "y", is_nullable => 0, size => 1 },
+ "admin_status", { data_type => "ENUM", default_value => "n", is_nullable => 0, size => 1 },
+ "comments", { data_type => "TEXT", default_value => "", is_nullable => 0, size => 65535 },
);
__PACKAGE__->set_primary_key("user_id");
-__PACKAGE__->add_unique_constraint("login", ["login"]);
-
+__PACKAGE__->add_unique_constraint( "login", ["login"] );
# Created by DBIx::Class::Schema::Loader v0.04002 @ 2007-08-09 16:13:40
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:4RbgZUha9qaD/QHFdiXuGw
-
# You can replace this text with custom content, and it will be preserved on regeneration
1;
__PACKAGE__->load_components("Core");
__PACKAGE__->table("yield_types");
__PACKAGE__->add_columns(
- "yield_type_id",
- { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
- "yield_type_name",
- { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 30 },
- "date_created",
- { data_type => "DATETIME", default_value => "", is_nullable => 0, size => 19 },
+ "yield_type_id", { data_type => "INT", default_value => undef, is_nullable => 0, size => 10 },
+ "yield_type_name", { data_type => "VARCHAR", default_value => "", is_nullable => 0, size => 30 },
+ "date_created", { data_type => "DATETIME", default_value => "", is_nullable => 0, size => 19 },
);
__PACKAGE__->set_primary_key("yield_type_id");
-__PACKAGE__->add_unique_constraint("yield_type_name", ["yield_type_name"]);
-
+__PACKAGE__->add_unique_constraint( "yield_type_name", ["yield_type_name"] );
# Created by DBIx::Class::Schema::Loader v0.04002 @ 2007-08-09 16:13:40
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:WuKiqaAPGCPQ5kC0gs+yqQ
-
# You can replace this text with custom content, and it will be preserved on regeneration
1;
open_dbs();
print "\n";
-exit 7 unless drop_target_tables();
-exit 8 unless create_target_tables();
+exit 7 unless drop_target_tables();
+exit 8 unless create_target_tables();
exit 77 unless import_data();
exit 99 unless optimize_target_tables();
print "\n";
return 1;
-}
+} ## end sub import_data
#-------------------------------------------------------------
return undef unless $source_sth->execute();
while ( $author = $source_sth->fetchrow_hashref() ) {
- $sql = 'SELECT count(*) AS `count` FROM `authors` WHERE `author_name` = ?';
+ $sql = 'SELECT count(*) AS `count` FROM `authors` WHERE `author_name` = ?';
$target_sth = $target_dbh->prepare($sql);
- unless ( $target_sth ) {
+ unless ($target_sth) {
$source_sth->finish();
return undef;
}
$source_sth->finish();
return undef;
}
- $row = $target_sth->fetchrow_hashref();
+ $row = $target_sth->fetchrow_hashref();
$count = $row->{'count'};
$target_sth->finish();
$qparams = [ $author->{'id'}, $author->{'name'} ];
$do_insert = 0;
- if ( $count ) {
+ if ($count) {
$sql = 'UPDATE `authors` SET `old_author_id` = ? WHERE `author_name` = ?';
}
else {
- $sql = 'INSERT INTO `authors` ( `old_author_id`, `author_name`, `date_created` ) VALUES ( ?, ?, now() )';
+ $sql = 'INSERT INTO `authors` ( `old_author_id`, `author_name`, `date_created` ) VALUES ( ?, ?, now() )';
$do_insert = 1;
}
unless ( $target_dbh->do( $sql, {}, @$qparams ) ) {
$source_sth->finish();
return undef;
}
- if ( $do_insert ) {
- $map_author_id{$author->{'id'}} = $target_dbh->{'mysql_insertid'};
+ if ($do_insert) {
+ $map_author_id{ $author->{'id'} } = $target_dbh->{'mysql_insertid'};
}
else {
- $map_author_id{$author->{'id'}} = 1;
+ $map_author_id{ $author->{'id'} } = 1;
}
- }
+ } ## end while ( $author = $source_sth->fetchrow_hashref...
return 1;
-}
+} ## end sub import_author_table
#-------------------------------------------------------------
return undef unless $target_dbh->do($sql);
return 1;
-}
+} ## end sub create_session_table
#-------------------------------------------------------------
return undef unless $target_dbh->do($sql);
return 1;
-}
+} ## end sub create_session_log_table
#-------------------------------------------------------------
return undef unless $target_dbh->do($sql);
return 1;
-}
+} ## end sub create_recipes_table
#-------------------------------------------------------------
)
END_SQL
$target_sth = $target_dbh->prepare($sql);
- unless ( $target_sth ) {
+ unless ($target_sth) {
$source_sth->finish();
return undef;
}
$i++;
my $digest_source = sprintf( '%07d-%s-%s', $i, time(), $recipe->{'title'} );
- my $digest = md5_hex($digest_source);
+ my $digest = md5_hex($digest_source);
$qparams = [
$recipe->{'id'},
$digest,
$recipe->{'title'},
$recipe->{'instructions'},
- $recipe->{'yield_amount'} || 0,
+ $recipe->{'yield_amount'} || 0,
$recipe->{'yield_amount_offset'} || undef,
( $recipe->{'yield_type_id'} and $recipe->{'yield_type_id'} > 0 ? $recipe->{'yield_type_id'} : undef ),
$recipe->{'prep_time'},
return undef;
}
- $map_recipe_id{$recipe->{'id'}} = $target_dbh->{'mysql_insertid'};
+ $map_recipe_id{ $recipe->{'id'} } = $target_dbh->{'mysql_insertid'};
- }
+ } ## end while ( $recipe = $source_sth->fetchrow_hashref...
return 1;
-}
+} ## end sub import_receipes_table
#-------------------------------------------------------------
return undef unless $target_dbh->do($sql);
return 1;
-}
+} ## end sub create_recipe_authors_table
#-------------------------------------------------------------
VALUES ( ?, ?, ?, now() )
END_SQL
$target_sth = $target_dbh->prepare($sql);
- unless ( $target_sth ) {
+ unless ($target_sth) {
$source_sth->finish();
return undef;
}
$old_rid = 0;
- $i = 0;
+ $i = 0;
while ( $row = $source_sth->fetchrow_hashref() ) {
$i++;
}
- $qparams = [
- $map_recipe_id{$row->{'recipe_id'}},
- $map_author_id{$row->{'author_id'}},
- $i,
- ];
+ $qparams = [ $map_recipe_id{ $row->{'recipe_id'} }, $map_author_id{ $row->{'author_id'} }, $i, ];
unless ( $target_dbh->do( $sql, {}, @$qparams ) ) {
$source_sth->finish();
return undef;
}
- }
+ } ## end while ( $row = $source_sth->fetchrow_hashref(...
return 1;
-}
+} ## end sub import_recipe_authors_table
#-------------------------------------------------------------
return undef unless $target_dbh->do($sql);
return 1;
-}
+} ## end sub create_yield_types_table
#-------------------------------------------------------------
VALUES ( ?, ?, now() )
END_SQL
$target_sth = $target_dbh->prepare($sql);
- unless ( $target_sth ) {
+ unless ($target_sth) {
$source_sth->finish();
return undef;
}
while ( $type = $source_sth->fetchrow_hashref() ) {
- $qparams = [
- $type->{'id'},
- $type->{'name'},
- ];
+ $qparams = [ $type->{'id'}, $type->{'name'}, ];
unless ( $target_dbh->do( $sql, {}, @$qparams ) ) {
$source_sth->finish();
return 1;
-}
+} ## end sub import_yield_types_table
#-------------------------------------------------------------