Bug 20568: API keys management in interface
[koha.git] / Koha / Schema / Result / ApiKey.pm
blob6767a568aacbef285dcd65521ef52e3a5af5ac2b
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 borrowernumber
28 data_type: 'integer'
29 is_foreign_key: 1
30 is_nullable: 0
32 =head2 api_key
34 data_type: 'varchar'
35 is_nullable: 0
36 size: 255
38 =head2 active
40 data_type: 'integer'
41 default_value: 1
42 is_nullable: 1
44 =cut
46 __PACKAGE__->add_columns(
47 "borrowernumber",
48 { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
49 "api_key",
50 { data_type => "varchar", is_nullable => 0, size => 255 },
51 "active",
52 { data_type => "integer", default_value => 1, is_nullable => 1 },
55 =head1 PRIMARY KEY
57 =over 4
59 =item * L</borrowernumber>
61 =item * L</api_key>
63 =back
65 =cut
67 __PACKAGE__->set_primary_key("borrowernumber", "api_key");
69 =head1 RELATIONS
71 =head2 borrowernumber
73 Type: belongs_to
75 Related object: L<Koha::Schema::Result::Borrower>
77 =cut
79 __PACKAGE__->belongs_to(
80 "borrowernumber",
81 "Koha::Schema::Result::Borrower",
82 { borrowernumber => "borrowernumber" },
83 { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
87 # Created by DBIx::Class::Schema::Loader v0.07025 @ 2015-03-24 07:35:30
88 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:dvujXVM5Vfu3SA2UfiVPtw
91 # You can replace this text with custom code or comments, and it will be preserved on regeneration