Added bootstrapping for basic database stuff
This commit is contained in:
parent
261751886b
commit
17dacd83c3
1 changed files with 22 additions and 0 deletions
|
@ -13,3 +13,25 @@ my @con = @ARGV;
|
||||||
my $schema = Pear::LocalLoop::Schema->connect(@con);
|
my $schema = Pear::LocalLoop::Schema->connect(@con);
|
||||||
|
|
||||||
$schema->deploy;
|
$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 => {},
|
||||||
|
});
|
||||||
|
|
||||||
|
}
|
||||||
|
|
Reference in a new issue