Bug 17196: [QA Follow-up] DBIx schema changes
authorMarcel de Rooy <m.de.rooy@rijksmuseum.nl>
Fri, 13 Jan 2017 07:37:17 +0000 (08:37 +0100)
committerKyle M Hall <kyle@bywatersolutions.com>
Fri, 13 Jan 2017 13:49:29 +0000 (13:49 +0000)
Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Koha/Schema/Result/Biblio.pm
Koha/Schema/Result/BiblioMetadata.pm [new file with mode: 0644]
Koha/Schema/Result/Biblioitem.pm
Koha/Schema/Result/Deletedbiblio.pm
Koha/Schema/Result/DeletedbiblioMetadata.pm [new file with mode: 0644]
Koha/Schema/Result/Deletedbiblioitem.pm

index 9a2f212..f4af407 100644 (file)
@@ -167,6 +167,21 @@ __PACKAGE__->has_many(
   { cascade_copy => 0, cascade_delete => 0 },
 );
 
+=head2 biblio_metadatas
+
+Type: has_many
+
+Related object: L<Koha::Schema::Result::BiblioMetadata>
+
+=cut
+
+__PACKAGE__->has_many(
+  "biblio_metadatas",
+  "Koha::Schema::Result::BiblioMetadata",
+  { "foreign.biblionumber" => "self.biblionumber" },
+  { cascade_copy => 0, cascade_delete => 0 },
+);
+
 =head2 biblioimages
 
 Type: has_many
@@ -333,7 +348,7 @@ __PACKAGE__->has_many(
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-10-24 13:56:21
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:IC5u5De1u1DS26kQQ7xmUQ
+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-01-13 08:36:25
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:jis7Sm5+9lVKav+o18JLtA
 
 1;
diff --git a/Koha/Schema/Result/BiblioMetadata.pm b/Koha/Schema/Result/BiblioMetadata.pm
new file mode 100644 (file)
index 0000000..0f2ec1d
--- /dev/null
@@ -0,0 +1,126 @@
+use utf8;
+package Koha::Schema::Result::BiblioMetadata;
+
+# Created by DBIx::Class::Schema::Loader
+# DO NOT MODIFY THE FIRST PART OF THIS FILE
+
+=head1 NAME
+
+Koha::Schema::Result::BiblioMetadata
+
+=cut
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class::Core';
+
+=head1 TABLE: C<biblio_metadata>
+
+=cut
+
+__PACKAGE__->table("biblio_metadata");
+
+=head1 ACCESSORS
+
+=head2 id
+
+  data_type: 'integer'
+  is_auto_increment: 1
+  is_nullable: 0
+
+=head2 biblionumber
+
+  data_type: 'integer'
+  is_foreign_key: 1
+  is_nullable: 0
+
+=head2 format
+
+  data_type: 'varchar'
+  is_nullable: 0
+  size: 16
+
+=head2 marcflavour
+
+  data_type: 'varchar'
+  is_nullable: 0
+  size: 16
+
+=head2 metadata
+
+  data_type: 'longtext'
+  is_nullable: 0
+
+=cut
+
+__PACKAGE__->add_columns(
+  "id",
+  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
+  "biblionumber",
+  { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
+  "format",
+  { data_type => "varchar", is_nullable => 0, size => 16 },
+  "marcflavour",
+  { data_type => "varchar", is_nullable => 0, size => 16 },
+  "metadata",
+  { data_type => "longtext", is_nullable => 0 },
+);
+
+=head1 PRIMARY KEY
+
+=over 4
+
+=item * L</id>
+
+=back
+
+=cut
+
+__PACKAGE__->set_primary_key("id");
+
+=head1 UNIQUE CONSTRAINTS
+
+=head2 C<biblio_metadata_uniq_key>
+
+=over 4
+
+=item * L</biblionumber>
+
+=item * L</format>
+
+=item * L</marcflavour>
+
+=back
+
+=cut
+
+__PACKAGE__->add_unique_constraint(
+  "biblio_metadata_uniq_key",
+  ["biblionumber", "format", "marcflavour"],
+);
+
+=head1 RELATIONS
+
+=head2 biblionumber
+
+Type: belongs_to
+
+Related object: L<Koha::Schema::Result::Biblio>
+
+=cut
+
+__PACKAGE__->belongs_to(
+  "biblionumber",
+  "Koha::Schema::Result::Biblio",
+  { biblionumber => "biblionumber" },
+  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
+);
+
+
+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-01-13 08:36:25
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:LoYje8i9pvKcBn8DQwH/Sg
+
+
+# You can replace this text with custom code or comments, and it will be preserved on regeneration
+1;
index a26314f..fcc9676 100644 (file)
@@ -203,11 +203,6 @@ __PACKAGE__->table("biblioitems");
   data_type: 'integer'
   is_nullable: 1
 
-=head2 marcxml
-
-  data_type: 'longtext'
-  is_nullable: 1
-
 =cut
 
 __PACKAGE__->add_columns(
@@ -285,8 +280,6 @@ __PACKAGE__->add_columns(
   { data_type => "varchar", is_nullable => 1, size => 255 },
   "totalissues",
   { data_type => "integer", is_nullable => 1 },
-  "marcxml",
-  { data_type => "longtext", is_nullable => 1 },
 );
 
 =head1 PRIMARY KEY
@@ -334,8 +327,8 @@ __PACKAGE__->has_many(
 );
 
 
-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-10-21 14:37:19
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:sIIeEpbe61VNkEYpUXNDkw
+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-01-13 08:36:25
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:cAlg2aIZ7hxeq+Hgl1AJcA
 
 __PACKAGE__->belongs_to( biblio => "Koha::Schema::Result::Biblio", "biblionumber" );
 
index 61adcd1..f3d314a 100644 (file)
@@ -135,9 +135,26 @@ __PACKAGE__->add_columns(
 
 __PACKAGE__->set_primary_key("biblionumber");
 
+=head1 RELATIONS
 
-# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:T381rHb43DPfZ7+d/WuSxQ
+=head2 deletedbiblio_metadatas
+
+Type: has_many
+
+Related object: L<Koha::Schema::Result::DeletedbiblioMetadata>
+
+=cut
+
+__PACKAGE__->has_many(
+  "deletedbiblio_metadatas",
+  "Koha::Schema::Result::DeletedbiblioMetadata",
+  { "foreign.biblionumber" => "self.biblionumber" },
+  { cascade_copy => 0, cascade_delete => 0 },
+);
+
+
+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-01-13 08:36:25
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:HBjJjCdFsEUOPmxexvK27g
 
 
 # You can replace this text with custom content, and it will be preserved on regeneration
diff --git a/Koha/Schema/Result/DeletedbiblioMetadata.pm b/Koha/Schema/Result/DeletedbiblioMetadata.pm
new file mode 100644 (file)
index 0000000..c20f04d
--- /dev/null
@@ -0,0 +1,126 @@
+use utf8;
+package Koha::Schema::Result::DeletedbiblioMetadata;
+
+# Created by DBIx::Class::Schema::Loader
+# DO NOT MODIFY THE FIRST PART OF THIS FILE
+
+=head1 NAME
+
+Koha::Schema::Result::DeletedbiblioMetadata
+
+=cut
+
+use strict;
+use warnings;
+
+use base 'DBIx::Class::Core';
+
+=head1 TABLE: C<deletedbiblio_metadata>
+
+=cut
+
+__PACKAGE__->table("deletedbiblio_metadata");
+
+=head1 ACCESSORS
+
+=head2 id
+
+  data_type: 'integer'
+  is_auto_increment: 1
+  is_nullable: 0
+
+=head2 biblionumber
+
+  data_type: 'integer'
+  is_foreign_key: 1
+  is_nullable: 0
+
+=head2 format
+
+  data_type: 'varchar'
+  is_nullable: 0
+  size: 16
+
+=head2 marcflavour
+
+  data_type: 'varchar'
+  is_nullable: 0
+  size: 16
+
+=head2 metadata
+
+  data_type: 'longtext'
+  is_nullable: 0
+
+=cut
+
+__PACKAGE__->add_columns(
+  "id",
+  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
+  "biblionumber",
+  { data_type => "integer", is_foreign_key => 1, is_nullable => 0 },
+  "format",
+  { data_type => "varchar", is_nullable => 0, size => 16 },
+  "marcflavour",
+  { data_type => "varchar", is_nullable => 0, size => 16 },
+  "metadata",
+  { data_type => "longtext", is_nullable => 0 },
+);
+
+=head1 PRIMARY KEY
+
+=over 4
+
+=item * L</id>
+
+=back
+
+=cut
+
+__PACKAGE__->set_primary_key("id");
+
+=head1 UNIQUE CONSTRAINTS
+
+=head2 C<deletedbiblio_metadata_uniq_key>
+
+=over 4
+
+=item * L</biblionumber>
+
+=item * L</format>
+
+=item * L</marcflavour>
+
+=back
+
+=cut
+
+__PACKAGE__->add_unique_constraint(
+  "deletedbiblio_metadata_uniq_key",
+  ["biblionumber", "format", "marcflavour"],
+);
+
+=head1 RELATIONS
+
+=head2 biblionumber
+
+Type: belongs_to
+
+Related object: L<Koha::Schema::Result::Deletedbiblio>
+
+=cut
+
+__PACKAGE__->belongs_to(
+  "biblionumber",
+  "Koha::Schema::Result::Deletedbiblio",
+  { biblionumber => "biblionumber" },
+  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
+);
+
+
+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-01-13 08:36:25
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:hKgy8bBepvfP/ZYPApJnwQ
+
+
+# You can replace this text with custom code or comments, and it will be preserved on regeneration
+1;
index ce588b7..ca5805f 100644 (file)
@@ -202,11 +202,6 @@ __PACKAGE__->table("deletedbiblioitems");
   data_type: 'integer'
   is_nullable: 1
 
-=head2 marcxml
-
-  data_type: 'longtext'
-  is_nullable: 1
-
 =cut
 
 __PACKAGE__->add_columns(
@@ -279,8 +274,6 @@ __PACKAGE__->add_columns(
   { data_type => "varchar", is_nullable => 1, size => 255 },
   "totalissues",
   { data_type => "integer", is_nullable => 1 },
-  "marcxml",
-  { data_type => "longtext", is_nullable => 1 },
 );
 
 =head1 PRIMARY KEY
@@ -296,8 +289,8 @@ __PACKAGE__->add_columns(
 __PACKAGE__->set_primary_key("biblioitemnumber");
 
 
-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2016-10-21 14:37:19
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Rijc/QK/Kdh3bMcbOTF8Tg
+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2017-01-13 08:36:25
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZFXb+BlsrsArv8qE2DrkkA
 
 
 # You can replace this text with custom content, and it will be preserved on regeneration