37 lines
613 B
Perl
Executable file
37 lines
613 B
Perl
Executable file
#! /usr/bin/env perl
|
|
|
|
use strict;
|
|
use warnings;
|
|
|
|
use FindBin qw/ $Bin /;
|
|
use lib "$Bin/../lib";
|
|
|
|
use Pear::LocalLoop::Schema;
|
|
|
|
my @con = @ARGV;
|
|
|
|
my $schema = Pear::LocalLoop::Schema->connect(@con);
|
|
|
|
$schema->deploy;
|
|
|
|
$schema->resultset('AgeRange')->populate([
|
|
[ qw/ string / ],
|
|
[ '20-35' ],
|
|
[ '35-50' ],
|
|
[ '50+' ],
|
|
]);
|
|
|
|
if ( $ENV{MOJO_MODE} eq 'development' ) {
|
|
|
|
$schema->resultset('User')->create({
|
|
email => 'test@example.com',
|
|
password => 'abc123',
|
|
customer => {
|
|
username => 'Test User',
|
|
age_range_id => 1,
|
|
postcode => 'LA1 1AA',
|
|
},
|
|
administrator => {},
|
|
});
|
|
|
|
}
|