Bug 8798: DBIx::Class base classes for all Koha tables
[koha.git] / Koha / Schema / Result / Patroncard.pm
1 package Koha::Schema::Result::Patroncard;
2
3 # Created by DBIx::Class::Schema::Loader
4 # DO NOT MODIFY THE FIRST PART OF THIS FILE
5
6 use strict;
7 use warnings;
8
9 use base 'DBIx::Class::Core';
10
11
12 =head1 NAME
13
14 Koha::Schema::Result::Patroncard
15
16 =cut
17
18 __PACKAGE__->table("patroncards");
19
20 =head1 ACCESSORS
21
22 =head2 cardid
23
24   data_type: 'integer'
25   is_auto_increment: 1
26   is_nullable: 0
27
28 =head2 batch_id
29
30   data_type: 'varchar'
31   default_value: 1
32   is_nullable: 0
33   size: 10
34
35 =head2 borrowernumber
36
37   data_type: 'integer'
38   is_foreign_key: 1
39   is_nullable: 0
40
41 =head2 timestamp
42
43   data_type: 'timestamp'
44   default_value: current_timestamp
45   is_nullable: 0
46
47 =cut
48
49 __PACKAGE__->add_columns(
50   "cardid",
51   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
52   "batch_id",
53   { data_type => "varchar", default_value => 1, is_nullable => 0, size => 10 },
54   "borrowernumber",
55   { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
56   "timestamp",
57   {
58     data_type     => "timestamp",
59     default_value => \"current_timestamp",
60     is_nullable   => 0,
61   },
62 );
63 __PACKAGE__->set_primary_key("cardid");
64
65 =head1 RELATIONS
66
67 =head2 borrowernumber
68
69 Type: belongs_to
70
71 Related object: L<Koha::Schema::Result::Borrower>
72
73 =cut
74
75 __PACKAGE__->belongs_to(
76   "borrowernumber",
77   "Koha::Schema::Result::Borrower",
78   { borrowernumber => "borrowernumber" },
79   { on_delete => "CASCADE", on_update => "CASCADE" },
80 );
81
82
83 # Created by DBIx::Class::Schema::Loader v0.07000 @ 2012-09-02 08:44:15
84 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:b/bNxn2Ca/bwRUjZjkoYBg
85
86
87 # You can replace this text with custom content, and it will be preserved on regeneration
88 1;