Bug 22521: DBRev 18.12.00.055
[koha.git] / Koha / Schema / Result / ItemtypeLocalization.pm
1 package Koha::Schema::Result::ItemtypeLocalization;
2
3 use base 'DBIx::Class::Core';
4
5 use Modern::Perl;
6
7 __PACKAGE__->table_class('DBIx::Class::ResultSource::View');
8
9 __PACKAGE__->table('itemtype_localizations');
10 __PACKAGE__->result_source_instance->is_virtual(1);
11 __PACKAGE__->result_source_instance->view_definition(
12     "SELECT localization_id, code, lang, translation FROM localization WHERE entity='itemtypes'"
13 );
14
15 __PACKAGE__->add_columns(
16   "localization_id",
17   { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
18   "code",
19   { data_type => "varchar", is_nullable => 0, size => 64 },
20   "lang",
21   { data_type => "varchar", is_nullable => 0, size => 25 },
22   "translation",
23   { data_type => "text", is_nullable => 1 },
24 );
25
26 __PACKAGE__->belongs_to(
27     "itemtype",
28     "Koha::Schema::Result::Itemtype",
29     { code => 'itemtype' }
30 );
31
32 1;