WWW::Battrick

Check-in [26473481a3]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:create schema
Timelines: family | ancestors | descendants | both | develop
Files: files | file ages | folders
SHA1:26473481a3463bfe2687dacfa3ec206c3e94f919
User & Date: erezs@teleweb.co.il 2011-09-07 15:40:12
Context
2011-09-07
15:51
login skeleton check-in: 7e55dbaf10 user: erezs@teleweb.co.il tags: develop
15:40
create schema check-in: 26473481a3 user: erezs@teleweb.co.il tags: develop
15:24
schemas check-in: d7a06f8d00 user: erezs@teleweb.co.il tags: trunk
Changes
Hide Diffs Unified Diffs Ignore Whitespace Patch

Changes to lib/WWW/Battrick.pm.

1
2
3






























4
5
6
7
use strict;
use warnings;
package WWW::Battrick;































sub run {
}
1;



>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>




1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
use strict;
use warnings;
package WWW::Battrick;

use WWW::Battrick::Schema;

use Moose;

has schema => (
    is => 'ro',
    isa => 'DBIx::Class::Schema',
    lazy_build => 1,
);

sub _build_schema {
    my $self = shift;

    unless (opendir my $DIR, "$ENV{HOME}/.battrick") {
        mkdir "$ENV{HOME}/.battrick";
    }

    my $schema = WWW:Battrick::Schema->connect(
        "dbi:SQLite:$ENV{HOME}/.battrick/data.db"
    );

    eval {
        $schema->resultset('Player')->search->all;
    };
    $schema->deploy if $@;

    return $schema;
}


sub run {
}
1;