Bug 24151: DBIC changes
authorJonathan Druart <jonathan.druart@bugs.koha-community.org>
Sat, 11 Jan 2020 15:56:10 +0000 (16:56 +0100)
committerJonathan Druart <jonathan.druart@bugs.koha-community.org>
Mon, 20 Jul 2020 13:17:42 +0000 (15:17 +0200)
Signed-off-by: Signed-off-by: Sonia Bouis <sonia.bouis@univ-lyon3.fr>

Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>

Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>

Koha/Schema/Result/Branch.pm
Koha/Schema/Result/Category.pm
Koha/Schema/Result/PseudonymizedTransaction.pm [new file with mode: 0644]

index 478c06f..37b2032 100644 (file)
@@ -683,6 +683,36 @@ __PACKAGE__->has_many(
   { cascade_copy => 0, cascade_delete => 0 },
 );
 
+=head2 pseudonymized_transactions_branchcodes
+
+Type: has_many
+
+Related object: L<Koha::Schema::Result::PseudonymizedTransaction>
+
+=cut
+
+__PACKAGE__->has_many(
+  "pseudonymized_transactions_branchcodes",
+  "Koha::Schema::Result::PseudonymizedTransaction",
+  { "foreign.branchcode" => "self.branchcode" },
+  { cascade_copy => 0, cascade_delete => 0 },
+);
+
+=head2 pseudonymized_transactions_transaction_branchcodes
+
+Type: has_many
+
+Related object: L<Koha::Schema::Result::PseudonymizedTransaction>
+
+=cut
+
+__PACKAGE__->has_many(
+  "pseudonymized_transactions_transaction_branchcodes",
+  "Koha::Schema::Result::PseudonymizedTransaction",
+  { "foreign.transaction_branchcode" => "self.branchcode" },
+  { cascade_copy => 0, cascade_delete => 0 },
+);
+
 =head2 repeatable_holidays
 
 Type: has_many
@@ -789,8 +819,8 @@ __PACKAGE__->has_many(
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-04-29 16:09:25
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9f0Crr57ffdoe8syXgawng
+# Created by DBIx::Class::Schema::Loader v0.07048 @ 2020-06-12 14:01:29
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hU6Ldf0uN2iV1h7llLH+4g
 
 __PACKAGE__->add_columns(
     '+pickup_location' => { is_boolean => 1 }
index cfe788c..16d7a22 100644 (file)
@@ -265,9 +265,24 @@ __PACKAGE__->has_many(
   { cascade_copy => 0, cascade_delete => 0 },
 );
 
+=head2 pseudonymized_transactions
 
-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2019-04-12 02:43:58
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:7rwTH9HuxcdRCBP/bj0d/A
+Type: has_many
+
+Related object: L<Koha::Schema::Result::PseudonymizedTransaction>
+
+=cut
+
+__PACKAGE__->has_many(
+  "pseudonymized_transactions",
+  "Koha::Schema::Result::PseudonymizedTransaction",
+  { "foreign.categorycode" => "self.categorycode" },
+  { cascade_copy => 0, cascade_delete => 0 },
+);
+
+
+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-01-11 15:54:08
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:mWu3jtWB0NXhGMjoapGfSg
 
 sub koha_object_class {
     'Koha::Patron::Category';
diff --git a/Koha/Schema/Result/PseudonymizedTransaction.pm b/Koha/Schema/Result/PseudonymizedTransaction.pm
new file mode 100644 (file)
index 0000000..61c3b61
--- /dev/null
@@ -0,0 +1,301 @@
+use utf8;
+package Koha::Schema::Result::PseudonymizedTransaction;
+
+# Created by DBIx::Class::Schema::Loader
+# DO NOT MODIFY THE FIRST PART OF THIS FILE
+
+=head1 NAME
+
+Koha::Schema::Result::PseudonymizedTransaction
+
+=cut
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class::Core';
+
+=head1 TABLE: C<pseudonymized_transactions>
+
+=cut
+
+__PACKAGE__->table("pseudonymized_transactions");
+
+=head1 ACCESSORS
+
+=head2 id
+
+  data_type: 'integer'
+  is_auto_increment: 1
+  is_nullable: 0
+
+=head2 hashed_borrowernumber
+
+  data_type: 'varchar'
+  is_nullable: 0
+  size: 60
+
+=head2 has_cardnumber
+
+  data_type: 'tinyint'
+  default_value: 0
+  is_nullable: 0
+
+=head2 title
+
+  data_type: 'longtext'
+  is_nullable: 1
+
+=head2 city
+
+  data_type: 'longtext'
+  is_nullable: 1
+
+=head2 state
+
+  data_type: 'mediumtext'
+  is_nullable: 1
+
+=head2 zipcode
+
+  data_type: 'varchar'
+  is_nullable: 1
+  size: 25
+
+=head2 country
+
+  data_type: 'mediumtext'
+  is_nullable: 1
+
+=head2 branchcode
+
+  data_type: 'varchar'
+  default_value: (empty string)
+  is_foreign_key: 1
+  is_nullable: 0
+  size: 10
+
+=head2 categorycode
+
+  data_type: 'varchar'
+  default_value: (empty string)
+  is_foreign_key: 1
+  is_nullable: 0
+  size: 10
+
+=head2 dateenrolled
+
+  data_type: 'date'
+  datetime_undef_if_invalid: 1
+  is_nullable: 1
+
+=head2 sex
+
+  data_type: 'varchar'
+  is_nullable: 1
+  size: 1
+
+=head2 sort1
+
+  data_type: 'varchar'
+  is_nullable: 1
+  size: 80
+
+=head2 sort2
+
+  data_type: 'varchar'
+  is_nullable: 1
+  size: 80
+
+=head2 datetime
+
+  data_type: 'datetime'
+  datetime_undef_if_invalid: 1
+  is_nullable: 1
+
+=head2 transaction_branchcode
+
+  data_type: 'varchar'
+  is_foreign_key: 1
+  is_nullable: 1
+  size: 10
+
+=head2 transaction_type
+
+  data_type: 'varchar'
+  is_nullable: 1
+  size: 16
+
+=head2 itemnumber
+
+  data_type: 'integer'
+  is_nullable: 1
+
+=head2 itemtype
+
+  data_type: 'varchar'
+  is_nullable: 1
+  size: 10
+
+=head2 holdingbranch
+
+  data_type: 'varchar'
+  is_nullable: 1
+  size: 10
+
+=head2 location
+
+  data_type: 'varchar'
+  is_nullable: 1
+  size: 80
+
+=head2 itemcallnumber
+
+  data_type: 'varchar'
+  is_nullable: 1
+  size: 255
+
+=head2 ccode
+
+  data_type: 'varchar'
+  is_nullable: 1
+  size: 80
+
+=cut
+
+__PACKAGE__->add_columns(
+  "id",
+  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
+  "hashed_borrowernumber",
+  { data_type => "varchar", is_nullable => 0, size => 60 },
+  "has_cardnumber",
+  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
+  "title",
+  { data_type => "longtext", is_nullable => 1 },
+  "city",
+  { data_type => "longtext", is_nullable => 1 },
+  "state",
+  { data_type => "mediumtext", is_nullable => 1 },
+  "zipcode",
+  { data_type => "varchar", is_nullable => 1, size => 25 },
+  "country",
+  { data_type => "mediumtext", is_nullable => 1 },
+  "branchcode",
+  {
+    data_type => "varchar",
+    default_value => "",
+    is_foreign_key => 1,
+    is_nullable => 0,
+    size => 10,
+  },
+  "categorycode",
+  {
+    data_type => "varchar",
+    default_value => "",
+    is_foreign_key => 1,
+    is_nullable => 0,
+    size => 10,
+  },
+  "dateenrolled",
+  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
+  "sex",
+  { data_type => "varchar", is_nullable => 1, size => 1 },
+  "sort1",
+  { data_type => "varchar", is_nullable => 1, size => 80 },
+  "sort2",
+  { data_type => "varchar", is_nullable => 1, size => 80 },
+  "datetime",
+  {
+    data_type => "datetime",
+    datetime_undef_if_invalid => 1,
+    is_nullable => 1,
+  },
+  "transaction_branchcode",
+  { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
+  "transaction_type",
+  { data_type => "varchar", is_nullable => 1, size => 16 },
+  "itemnumber",
+  { data_type => "integer", is_nullable => 1 },
+  "itemtype",
+  { data_type => "varchar", is_nullable => 1, size => 10 },
+  "holdingbranch",
+  { data_type => "varchar", is_nullable => 1, size => 10 },
+  "location",
+  { data_type => "varchar", is_nullable => 1, size => 80 },
+  "itemcallnumber",
+  { data_type => "varchar", is_nullable => 1, size => 255 },
+  "ccode",
+  { data_type => "varchar", is_nullable => 1, size => 80 },
+);
+
+=head1 PRIMARY KEY
+
+=over 4
+
+=item * L</id>
+
+=back
+
+=cut
+
+__PACKAGE__->set_primary_key("id");
+
+=head1 RELATIONS
+
+=head2 branchcode
+
+Type: belongs_to
+
+Related object: L<Koha::Schema::Result::Branch>
+
+=cut
+
+__PACKAGE__->belongs_to(
+  "branchcode",
+  "Koha::Schema::Result::Branch",
+  { branchcode => "branchcode" },
+  { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" },
+);
+
+=head2 categorycode
+
+Type: belongs_to
+
+Related object: L<Koha::Schema::Result::Category>
+
+=cut
+
+__PACKAGE__->belongs_to(
+  "categorycode",
+  "Koha::Schema::Result::Category",
+  { categorycode => "categorycode" },
+  { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" },
+);
+
+=head2 transaction_branchcode
+
+Type: belongs_to
+
+Related object: L<Koha::Schema::Result::Branch>
+
+=cut
+
+__PACKAGE__->belongs_to(
+  "transaction_branchcode",
+  "Koha::Schema::Result::Branch",
+  { branchcode => "transaction_branchcode" },
+  {
+    is_deferrable => 1,
+    join_type     => "LEFT",
+    on_delete     => "RESTRICT",
+    on_update     => "RESTRICT",
+  },
+);
+
+
+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2020-01-11 16:08:51
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:r3YdoQ6TKEF0THmeXHvRwA
+
+
+# You can replace this text with custom code or comments, and it will be preserved on regeneration
+1;