Bug 23152: Implement koha_object[s]_class when needed
[koha-equinox.git] / Koha / Schema / Result / OldReserve.pm
index 384dbf3..de9fc6c 100644 (file)
@@ -1,17 +1,21 @@
+use utf8;
 package Koha::Schema::Result::OldReserve;
 
 # Created by DBIx::Class::Schema::Loader
 # DO NOT MODIFY THE FIRST PART OF THIS FILE
 
+=head1 NAME
+
+Koha::Schema::Result::OldReserve
+
+=cut
+
 use strict;
 use warnings;
 
 use base 'DBIx::Class::Core';
 
-
-=head1 NAME
-
-Koha::Schema::Result::OldReserve
+=head1 TABLE: C<old_reserves>
 
 =cut
 
@@ -33,6 +37,7 @@ __PACKAGE__->table("old_reserves");
 =head2 reservedate
 
   data_type: 'date'
+  datetime_undef_if_invalid: 1
   is_nullable: 1
 
 =head2 biblionumber
@@ -41,12 +46,6 @@ __PACKAGE__->table("old_reserves");
   is_foreign_key: 1
   is_nullable: 1
 
-=head2 constrainttype
-
-  data_type: 'varchar'
-  is_nullable: 1
-  size: 1
-
 =head2 branchcode
 
   data_type: 'varchar'
@@ -56,21 +55,24 @@ __PACKAGE__->table("old_reserves");
 =head2 notificationdate
 
   data_type: 'date'
+  datetime_undef_if_invalid: 1
   is_nullable: 1
 
 =head2 reminderdate
 
   data_type: 'date'
+  datetime_undef_if_invalid: 1
   is_nullable: 1
 
 =head2 cancellationdate
 
   data_type: 'date'
+  datetime_undef_if_invalid: 1
   is_nullable: 1
 
 =head2 reservenotes
 
-  data_type: 'mediumtext'
+  data_type: 'longtext'
   is_nullable: 1
 
 =head2 priority
@@ -87,6 +89,7 @@ __PACKAGE__->table("old_reserves");
 =head2 timestamp
 
   data_type: 'timestamp'
+  datetime_undef_if_invalid: 1
   default_value: current_timestamp
   is_nullable: 0
 
@@ -99,16 +102,20 @@ __PACKAGE__->table("old_reserves");
 =head2 waitingdate
 
   data_type: 'date'
+  datetime_undef_if_invalid: 1
   is_nullable: 1
 
 =head2 expirationdate
 
   data_type: 'date'
+  datetime_undef_if_invalid: 1
   is_nullable: 1
 
-=head2 lowestpriority
+=head2 lowestPriority
 
+  accessor: 'lowest_priority'
   data_type: 'tinyint'
+  default_value: 0
   is_nullable: 0
 
 =head2 suspend
@@ -120,12 +127,21 @@ __PACKAGE__->table("old_reserves");
 =head2 suspend_until
 
   data_type: 'datetime'
+  datetime_undef_if_invalid: 1
   is_nullable: 1
 
-=head2 maxpickupdate
+=head2 itemtype
 
-  data_type: 'date'
+  data_type: 'varchar'
+  is_foreign_key: 1
   is_nullable: 1
+  size: 10
+
+=head2 item_level_hold
+
+  data_type: 'tinyint'
+  default_value: 0
+  is_nullable: 0
 
 =cut
 
@@ -135,64 +151,70 @@ __PACKAGE__->add_columns(
   "borrowernumber",
   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
   "reservedate",
-  { data_type => "date", is_nullable => 1 },
+  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
   "biblionumber",
   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
-  "constrainttype",
-  { data_type => "varchar", is_nullable => 1, size => 1 },
   "branchcode",
   { data_type => "varchar", is_nullable => 1, size => 10 },
   "notificationdate",
-  { data_type => "date", is_nullable => 1 },
+  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
   "reminderdate",
-  { data_type => "date", is_nullable => 1 },
+  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
   "cancellationdate",
-  { data_type => "date", is_nullable => 1 },
+  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
   "reservenotes",
-  { data_type => "mediumtext", is_nullable => 1 },
+  { data_type => "longtext", is_nullable => 1 },
   "priority",
   { data_type => "smallint", is_nullable => 1 },
   "found",
   { data_type => "varchar", is_nullable => 1, size => 1 },
   "timestamp",
   {
-    data_type     => "timestamp",
+    data_type => "timestamp",
+    datetime_undef_if_invalid => 1,
     default_value => \"current_timestamp",
-    is_nullable   => 0,
+    is_nullable => 0,
   },
   "itemnumber",
   { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
   "waitingdate",
-  { data_type => "date", is_nullable => 1 },
+  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
   "expirationdate",
-  { data_type => "date", is_nullable => 1 },
-  "lowestpriority",
-  { data_type => "tinyint", is_nullable => 0 },
+  { data_type => "date", datetime_undef_if_invalid => 1, is_nullable => 1 },
+  "lowestPriority",
+  {
+    accessor      => "lowest_priority",
+    data_type     => "tinyint",
+    default_value => 0,
+    is_nullable   => 0,
+  },
   "suspend",
   { data_type => "tinyint", default_value => 0, is_nullable => 0 },
   "suspend_until",
-  { data_type => "datetime", is_nullable => 1 },
-  "maxpickupdate",
-  { data_type => "date", is_nullable => 1 },
+  {
+    data_type => "datetime",
+    datetime_undef_if_invalid => 1,
+    is_nullable => 1,
+  },
+  "itemtype",
+  { data_type => "varchar", is_foreign_key => 1, is_nullable => 1, size => 10 },
+  "item_level_hold",
+  { data_type => "tinyint", default_value => 0, is_nullable => 0 },
 );
-__PACKAGE__->set_primary_key("reserve_id");
 
-=head1 RELATIONS
+=head1 PRIMARY KEY
 
-=head2 borrowernumber
+=over 4
 
-Type: belongs_to
+=item * L</reserve_id>
 
-Related object: L<Koha::Schema::Result::Borrower>
+=back
 
 =cut
 
-__PACKAGE__->belongs_to(
-  "borrowernumber",
-  "Koha::Schema::Result::Borrower",
-  { borrowernumber => "borrowernumber" },
-  { join_type => "LEFT", on_delete => "CASCADE", on_update => "CASCADE" },
-);
+__PACKAGE__->set_primary_key("reserve_id");
+
+=head1 RELATIONS
 
 =head2 biblionumber
 
@@ -206,7 +228,32 @@ __PACKAGE__->belongs_to(
   "biblionumber",
   "Koha::Schema::Result::Biblio",
   { biblionumber => "biblionumber" },
-  { join_type => "LEFT", on_delete => "CASCADE", on_update => "CASCADE" },
+  {
+    is_deferrable => 1,
+    join_type     => "LEFT",
+    on_delete     => "SET NULL",
+    on_update     => "SET NULL",
+  },
+);
+
+=head2 borrowernumber
+
+Type: belongs_to
+
+Related object: L<Koha::Schema::Result::Borrower>
+
+=cut
+
+__PACKAGE__->belongs_to(
+  "borrowernumber",
+  "Koha::Schema::Result::Borrower",
+  { borrowernumber => "borrowernumber" },
+  {
+    is_deferrable => 1,
+    join_type     => "LEFT",
+    on_delete     => "SET NULL",
+    on_update     => "SET NULL",
+  },
 );
 
 =head2 itemnumber
@@ -221,13 +268,43 @@ __PACKAGE__->belongs_to(
   "itemnumber",
   "Koha::Schema::Result::Item",
   { itemnumber => "itemnumber" },
-  { join_type => "LEFT", on_delete => "CASCADE", on_update => "CASCADE" },
+  {
+    is_deferrable => 1,
+    join_type     => "LEFT",
+    on_delete     => "SET NULL",
+    on_update     => "SET NULL",
+  },
+);
+
+=head2 itemtype
+
+Type: belongs_to
+
+Related object: L<Koha::Schema::Result::Itemtype>
+
+=cut
+
+__PACKAGE__->belongs_to(
+  "itemtype",
+  "Koha::Schema::Result::Itemtype",
+  { itemtype => "itemtype" },
+  {
+    is_deferrable => 1,
+    join_type     => "LEFT",
+    on_delete     => "SET NULL",
+    on_update     => "SET NULL",
+  },
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07000 @ 2013-06-18 13:13:57
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Ni1RNxdeOoypM+GwYu1vAQ
+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-06-17 07:24:39
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZgGAW7ODBby3hGNJ41eeMA
 
+sub koha_object_class {
+    'Koha::Old::Hold';
+}
+sub koha_objects_class {
+    'Koha::Old::Holds';
+}
 
-# You can replace this text with custom content, and it will be preserved on regeneration
 1;