Bug 20434: Update UNIMARC framework - auth (SAUTTIT)
[koha.git] / Koha / Schema / Result / ApiKey.pm
blobf8e091fbb707affd8b8aef1497be7a94bdd8ca00
1 use utf8;
2 package Koha::Schema::Result::ApiKey;
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
7 =head1 NAME
9 Koha::Schema::Result::ApiKey
11 =cut
13 use strict;
14 use warnings;
16 use base 'DBIx::Class::Core';
18 =head1 TABLE: C<api_keys>
20 =cut
22 __PACKAGE__->table("api_keys");
24 =head1 ACCESSORS
26 =head2 client_id
28 data_type: 'varchar'
29 is_nullable: 0
30 size: 191
32 =head2 secret
34 data_type: 'varchar'
35 is_nullable: 0
36 size: 191
38 =head2 description
40 data_type: 'varchar'
41 is_nullable: 0
42 size: 255
44 =head2 patron_id
46 data_type: 'integer'
47 is_foreign_key: 1
48 is_nullable: 0
50 =head2 active
52 data_type: 'tinyint'
53 default_value: 1
54 is_nullable: 0
56 =cut
58 __PACKAGE__->add_columns(
59 "client_id",
60 { data_type => "varchar", is_nullable => 0, size => 191 },
61 "secret",
62 { data_type => "varchar", is_nullable => 0, size => 191 },
63 "description",
64 { data_type => "varchar", is_nullable => 0, size => 255 },
65 "patron_id",
66 { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
67 "active",
68 { data_type => "tinyint", default_value => 1, is_nullable => 0 },
71 =head1 PRIMARY KEY
73 =over 4
75 =item * L</client_id>
77 =back
79 =cut
81 __PACKAGE__->set_primary_key("client_id");
83 =head1 UNIQUE CONSTRAINTS
85 =head2 C<secret>
87 =over 4
89 =item * L</secret>
91 =back
93 =cut
95 __PACKAGE__->add_unique_constraint("secret", ["secret"]);
97 =head1 RELATIONS
99 =head2 patron
101 Type: belongs_to
103 Related object: L<Koha::Schema::Result::Borrower>
105 =cut
107 __PACKAGE__->belongs_to(
108 "patron",
109 "Koha::Schema::Result::Borrower",
110 { borrowernumber => "patron_id" },
111 { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
115 # Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-04-14 14:48:10
116 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:qnu4QSACpOSQaZgd52ozmw
118 __PACKAGE__->add_columns(
119 '+active' => { is_boolean => 1 }
122 # You can replace this text with custom code or comments, and it will be preserved on regeneration