2 package Koha::Schema::Result::ApiKey;
4 # Created by DBIx::Class::Schema::Loader
5 # DO NOT MODIFY THE FIRST PART OF THIS FILE
9 Koha::Schema::Result::ApiKey
16 use base 'DBIx::Class::Core';
18 =head1 TABLE: C<api_keys>
22 __PACKAGE__->table("api_keys");
40 API client secret used for API authentication
48 API client description
56 Foreign key to the borrowers table
64 0 means this API key is revoked
68 __PACKAGE__->add_columns(
70 { data_type => "varchar", is_nullable => 0, size => 191 },
72 { data_type => "varchar", is_nullable => 0, size => 191 },
74 { data_type => "varchar", is_nullable => 0, size => 255 },
76 { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
78 { data_type => "tinyint", default_value => 1, is_nullable => 0 },
91 __PACKAGE__->set_primary_key("client_id");
93 =head1 UNIQUE CONSTRAINTS
105 __PACKAGE__->add_unique_constraint("secret", ["secret"]);
113 Related object: L<Koha::Schema::Result::Borrower>
117 __PACKAGE__->belongs_to(
119 "Koha::Schema::Result::Borrower",
120 { borrowernumber => "patron_id" },
121 { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
125 # Created by DBIx::Class::Schema::Loader v0.07049 @ 2021-01-21 13:39:29
126 # DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:2yvvoid4Taq7cjXFDuMoAA
128 __PACKAGE__->add_columns(
129 '+active' => { is_boolean => 1 }
132 # You can replace this text with custom code or comments, and it will be preserved on regeneration