# - #4 : the developer version. The 4th number is the database subversion.
# used by developers when the database changes. updatedatabase take care of the changes itself
# and is automatically called by Auth.pm when needed.
-$VERSION = "18.12.00.074";
+$VERSION = "18.12.00.075";
sub version {
return $VERSION;
{ cascade_copy => 0, cascade_delete => 0 },
);
+=head2 tmp_holdsqueues
-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-10-09 15:50:42
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:PQvA8qoxvTe4In5/oa5WIQ
+Type: has_many
+
+Related object: L<Koha::Schema::Result::TmpHoldsqueue>
+
+=cut
+
+__PACKAGE__->has_many(
+ "tmp_holdsqueues",
+ "Koha::Schema::Result::TmpHoldsqueue",
+ { "foreign.itemnumber" => "self.itemnumber" },
+ { cascade_copy => 0, cascade_delete => 0 },
+);
+
+
+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-05-14 18:14:09
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:wDXcErUYqg0aoQkzz3P5vg
__PACKAGE__->belongs_to( biblioitem => "Koha::Schema::Result::Biblioitem", "biblioitemnumber" );
=head2 itemnumber
data_type: 'integer'
+ is_foreign_key: 1
is_nullable: 1
=head2 barcode
"biblionumber",
{ data_type => "integer", is_nullable => 1 },
"itemnumber",
- { data_type => "integer", is_nullable => 1 },
+ { data_type => "integer", is_foreign_key => 1, is_nullable => 1 },
"barcode",
{ data_type => "varchar", is_nullable => 1, size => 20 },
"surname",
{ data_type => "tinyint", default_value => 0, is_nullable => 0 },
);
+=head1 RELATIONS
+
+=head2 itemnumber
+
+Type: belongs_to
+
+Related object: L<Koha::Schema::Result::Item>
+
+=cut
+
+__PACKAGE__->belongs_to(
+ "itemnumber",
+ "Koha::Schema::Result::Item",
+ { itemnumber => "itemnumber" },
+ {
+ is_deferrable => 1,
+ join_type => "LEFT",
+ on_delete => "CASCADE",
+ on_update => "CASCADE",
+ },
+);
+
-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2018-02-16 17:54:54
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:1Wa4h3u3FePOhGPD8SHEWg
+# Created by DBIx::Class::Schema::Loader v0.07046 @ 2019-05-14 18:14:09
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:tzgAgf+OVO+IncaTr7SZuQ
# You can replace this text with custom content, and it will be preserved on regeneration
+++ /dev/null
-$DBversion = 'XXX'; # will be replaced by the RM
-if( CheckVersion( $DBversion ) ) {
- # you can use $dbh here like:
- unless ( foreign_key_exists( 'tmp_holdsqueue', 'tmp_holdsqueue_ibfk_1' ) ) {
- $dbh->do(q{
- DELETE t FROM tmp_holdsqueue t
- LEFT JOIN items i ON t.itemnumber=i.itemnumber
- WHERE i.itemnumber IS NULL
- });
- $dbh->do(q{
- ALTER TABLE tmp_holdsqueue
- ADD CONSTRAINT `tmp_holdsqueue_ibfk_1` FOREIGN KEY (`itemnumber`)
- REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE
- });
- }
- SetVersion( $DBversion );
- print "Upgrade to $DBversion done (Bug XXXXX - Add items constraint to tmp_holdsqueue)\n";
-}
print "Upgrade to $DBversion done (Bug 21411 - Add keyboard_shortcuts table)\n";
}
+$DBversion = '18.12.00.075';
+if( CheckVersion( $DBversion ) ) {
+ # you can use $dbh here like:
+ unless ( foreign_key_exists( 'tmp_holdsqueue', 'tmp_holdsqueue_ibfk_1' ) ) {
+ $dbh->do(q{
+ DELETE t FROM tmp_holdsqueue t
+ LEFT JOIN items i ON t.itemnumber=i.itemnumber
+ WHERE i.itemnumber IS NULL
+ });
+ $dbh->do(q{
+ ALTER TABLE tmp_holdsqueue
+ ADD CONSTRAINT `tmp_holdsqueue_ibfk_1` FOREIGN KEY (`itemnumber`)
+ REFERENCES `items` (`itemnumber`) ON DELETE CASCADE ON UPDATE CASCADE
+ });
+ }
+ SetVersion( $DBversion );
+ print "Upgrade to $DBversion done (Bug 22899 - Add items constraint to tmp_holdsqueue)\n";
+}
+
# SEE bug 13068
# if there is anything in the atomicupdate, read and execute it.