Conform to change of database name.
This commit is contained in:
parent
dde8343978
commit
390850ec75
|
@ -4,7 +4,6 @@ use Moose;
|
|||
use Moose::Util::TypeConstraints;
|
||||
use Mojo::Log;
|
||||
use Book::Schema;
|
||||
use List::Util qw( max min );
|
||||
no warnings qw( experimental::signatures );
|
||||
|
||||
# Keep rows-per-page within a somewhat-sane range.
|
||||
|
@ -19,6 +18,7 @@ has 'rows_per_page' => (
|
|||
default => 20,
|
||||
);
|
||||
|
||||
our $dbname = "pg_book_catalog";
|
||||
our $logger = Mojo::Log->new;
|
||||
|
||||
# Share this among all model instances.
|
||||
|
@ -26,8 +26,8 @@ our $schema;
|
|||
|
||||
sub schema ($self) {
|
||||
if (!defined $schema) {
|
||||
$logger->info("Connecting to database.");
|
||||
$schema = Book::Schema->connect('dbi:Pg:');
|
||||
$logger->info("Connecting to database $dbname.");
|
||||
$schema = Book::Schema->connect("dbi:Pg:dbname=$dbname");
|
||||
}
|
||||
return $schema;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue