From 02b0af23b7e5fef07ea15b60c4e73a8d820c8335 Mon Sep 17 00:00:00 2001 From: Martin Renvoize Date: Mon, 28 Mar 2022 16:04:09 +0100 Subject: [PATCH] Bug 24975: DBIC Build https://bugs.koha-community.org/show_bug.cgi?id=24875 --- Koha/Schema/Result/L10nSource.pm | 113 +++++++++++++++++++++++++++++ Koha/Schema/Result/L10nTarget.pm | 121 +++++++++++++++++++++++++++++++ 2 files changed, 234 insertions(+) create mode 100644 Koha/Schema/Result/L10nSource.pm create mode 100644 Koha/Schema/Result/L10nTarget.pm diff --git a/Koha/Schema/Result/L10nSource.pm b/Koha/Schema/Result/L10nSource.pm new file mode 100644 index 0000000000..2f789481b3 --- /dev/null +++ b/Koha/Schema/Result/L10nSource.pm @@ -0,0 +1,113 @@ +use utf8; +package Koha::Schema::Result::L10nSource; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::L10nSource + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("l10n_source"); + +=head1 ACCESSORS + +=head2 l10n_source_id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +=head2 group + + data_type: 'varchar' + is_nullable: 1 + size: 100 + +=head2 key + + data_type: 'varchar' + is_nullable: 0 + size: 100 + +=head2 text + + data_type: 'text' + is_nullable: 0 + +=cut + +__PACKAGE__->add_columns( + "l10n_source_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "group", + { data_type => "varchar", is_nullable => 1, size => 100 }, + "key", + { data_type => "varchar", is_nullable => 0, size => 100 }, + "text", + { data_type => "text", is_nullable => 0 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("l10n_source_id"); + +=head1 UNIQUE CONSTRAINTS + +=head2 C + +=over 4 + +=item * L + +=item * L + +=back + +=cut + +__PACKAGE__->add_unique_constraint("group_key", ["group", "key"]); + +=head1 RELATIONS + +=head2 l10n_targets + +Type: has_many + +Related object: L + +=cut + +__PACKAGE__->has_many( + "l10n_targets", + "Koha::Schema::Result::L10nTarget", + { "foreign.l10n_source_id" => "self.l10n_source_id" }, + { cascade_copy => 0, cascade_delete => 0 }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-03-28 15:03:23 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:QRPw3vO+2BbF4AmGCuucGw + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; diff --git a/Koha/Schema/Result/L10nTarget.pm b/Koha/Schema/Result/L10nTarget.pm new file mode 100644 index 0000000000..c2d7f20790 --- /dev/null +++ b/Koha/Schema/Result/L10nTarget.pm @@ -0,0 +1,121 @@ +use utf8; +package Koha::Schema::Result::L10nTarget; + +# Created by DBIx::Class::Schema::Loader +# DO NOT MODIFY THE FIRST PART OF THIS FILE + +=head1 NAME + +Koha::Schema::Result::L10nTarget + +=cut + +use strict; +use warnings; + +use base 'DBIx::Class::Core'; + +=head1 TABLE: C + +=cut + +__PACKAGE__->table("l10n_target"); + +=head1 ACCESSORS + +=head2 l10n_target_id + + data_type: 'integer' + is_auto_increment: 1 + is_nullable: 0 + +=head2 l10n_source_id + + data_type: 'integer' + is_foreign_key: 1 + is_nullable: 0 + +=head2 language + + data_type: 'varchar' + is_nullable: 0 + size: 10 + +=head2 translation + + data_type: 'text' + is_nullable: 0 + +=head2 fuzzy + + data_type: 'tinyint' + default_value: 0 + is_nullable: 0 + +=cut + +__PACKAGE__->add_columns( + "l10n_target_id", + { data_type => "integer", is_auto_increment => 1, is_nullable => 0 }, + "l10n_source_id", + { data_type => "integer", is_foreign_key => 1, is_nullable => 0 }, + "language", + { data_type => "varchar", is_nullable => 0, size => 10 }, + "translation", + { data_type => "text", is_nullable => 0 }, + "fuzzy", + { data_type => "tinyint", default_value => 0, is_nullable => 0 }, +); + +=head1 PRIMARY KEY + +=over 4 + +=item * L + +=back + +=cut + +__PACKAGE__->set_primary_key("l10n_target_id"); + +=head1 UNIQUE CONSTRAINTS + +=head2 C + +=over 4 + +=item * L + +=item * L + +=back + +=cut + +__PACKAGE__->add_unique_constraint("l10n_source_language", ["l10n_source_id", "language"]); + +=head1 RELATIONS + +=head2 l10n_source + +Type: belongs_to + +Related object: L + +=cut + +__PACKAGE__->belongs_to( + "l10n_source", + "Koha::Schema::Result::L10nSource", + { l10n_source_id => "l10n_source_id" }, + { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" }, +); + + +# Created by DBIx::Class::Schema::Loader v0.07049 @ 2022-03-28 15:03:23 +# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:oXnI0NR9rifXbtfWYqcxzg + + +# You can replace this text with custom code or comments, and it will be preserved on regeneration +1; -- 2.20.1