might_have with non pk fk
[chaz/p5-DBIx-Class-ResultSet-RecursiveUpdate] / t / lib / DBSchema.pm
1 package DBSchema;
2
3 # Created by DBIx::Class::Schema::Loader v0.03000 @ 2006-10-02 08:24:09
4
5 use strict;
6 use warnings;
7
8 use base 'DBIx::Class::Schema';
9 use DateTime;
10
11 __PACKAGE__->load_namespaces( default_resultset_class => '+DBIx::Class::ResultSet::RecursiveUpdate' );
12
13 sub get_test_schema {
14 my ( $dsn, $user, $pass ) = @_;
15 $dsn ||= 'dbi:SQLite:dbname=t/var/dvdzbr.db';
16 warn "testing $dsn";
17 my $schema = __PACKAGE__->connect( $dsn, $user, $pass, {} );
18 $schema->deploy({ add_drop_table => 1, });
19 $schema->populate('User', [
20 [ qw/username name password / ],
21 [ 'jgda', 'Jonas Alves', ''],
22 [ 'isa' , 'Isa', '', ],
23 [ 'zby' , 'Zbyszek Lukasiak', ''],
24 ]
25 );
26 $schema->populate('Tag', [
27 [ qw/name file / ],
28 [ 'comedy', '' ],
29 [ 'dramat', '' ],
30 [ 'australian', '' ],
31 ]
32 );
33 $schema->populate('Dvd', [
34 [ qw/name imdb_id owner current_borrower creation_date alter_date / ],
35 [ 'Picnick under the Hanging Rock', 123, 1, 3, '2003-01-16 23:12:01', undef ],
36 [ 'The Deerhunter', 1234, 1, 1, undef, undef ],
37 [ 'Rejs', 1235, 3, 1, undef, undef ],
38 [ 'Seksmisja', 1236, 3, 1, undef, undef ],
39 ]
40 );
41 $schema->populate( 'Dvdtag', [
42 [ qw/ dvd tag / ],
43 [ 1, 2 ],
44 [ 1, 3 ],
45 [ 3, 1 ],
46 [ 4, 1 ],
47 ]
48 );
49 return $schema;
50 }
51
52
53 1;
54
This page took 0.032255 seconds and 4 git commands to generate.