first commit
[slists.git] / lib / Slists / Schema / Result / List.pm
blob301ebeb2600b63bffd3516f4bbd75e037d0da401
1 use utf8;
2 package Slists::Schema::Result::List;
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
7 =head1 NAME
9 Slists::Schema::Result::List
11 =cut
13 use strict;
14 use warnings;
16 use Moose;
17 use MooseX::NonMoose;
18 use MooseX::MarkAsMethods autoclean => 1;
19 extends 'DBIx::Class::Core';
21 =head1 COMPONENTS LOADED
23 =over 4
25 =item * L<DBIx::Class::InflateColumn::DateTime>
27 =item * L<DBIx::Class::TimeStamp>
29 =item * L<DBIx::Class::PassphraseColumn>
31 =back
33 =cut
35 __PACKAGE__->load_components("InflateColumn::DateTime", "TimeStamp", "PassphraseColumn");
37 =head1 TABLE: C<lists>
39 =cut
41 __PACKAGE__->table("lists");
43 =head1 ACCESSORS
45 =head2 id
47 data_type: 'integer'
48 is_auto_increment: 1
49 is_nullable: 0
51 =head2 user_id
53 data_type: 'integer'
54 is_foreign_key: 1
55 is_nullable: 1
57 =head2 title
59 data_type: 'text'
60 is_nullable: 1
62 =head2 created
64 data_type: 'timestamp'
65 is_nullable: 1
67 =head2 updated
69 data_type: 'timestamp'
70 is_nullable: 1
72 =cut
74 __PACKAGE__->add_columns(
75 "id",
76 { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
77 "user_id",
78 { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
79 "title",
80 { data_type => "text", is_nullable => 1 },
81 "created",
82 { data_type => "timestamp", is_nullable => 1 },
83 "updated",
84 { data_type => "timestamp", is_nullable => 1 },
87 =head1 PRIMARY KEY
89 =over 4
91 =item * L</id>
93 =back
95 =cut
97 __PACKAGE__->set_primary_key("id");
99 =head1 RELATIONS
101 =head2 list_items
103 Type: has_many
105 Related object: L<Slists::Schema::Result::ListItem>
107 =cut
109 __PACKAGE__->has_many(
110 "list_items",
111 "Slists::Schema::Result::ListItem",
112 { "foreign.list_id" => "self.id" },
113 { cascade_copy => 0, cascade_delete => 0 },
116 =head2 user
118 Type: belongs_to
120 Related object: L<Slists::Schema::Result::User>
122 =cut
124 __PACKAGE__->belongs_to(
125 "user",
126 "Slists::Schema::Result::User",
127 { id => "user_id" },
129 is_deferrable => 0,
130 join_type => "LEFT",
131 on_delete => "NO ACTION",
132 on_update => "NO ACTION",
137 # Created by DBIx::Class::Schema::Loader v0.07033 @ 2013-01-27 14:24:58
138 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:OeF6u7zvM8S+dDaHW068DA
140 # Enable automatic date handling
142 __PACKAGE__->add_columns(
143 "created",
144 { data_type => 'timestamp', set_on_create => 1 },
145 "updated",
146 { data_type => 'timestamp', set_on_create => 1, set_on_update => 1 },
149 # You can replace this text with custom code or comments, and it will be preserved on regeneration
150 __PACKAGE__->meta->make_immutable;