the name of the field as it will be stored in the search engine
+=head2 label
+
+ data_type: 'varchar'
+ is_nullable: 1
+ size: 255
+
=head2 type
data_type: 'enum'
{ data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
"name",
{ data_type => "varchar", is_nullable => 0, size => 255 },
+ "label",
+ { data_type => "varchar", is_nullable => 1, size => 255 },
"type",
{
data_type => "enum",
__PACKAGE__->many_to_many("search_marc_maps", "search_marc_to_fields", "search_marc_map");
-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-09-01 16:56:47
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:VN1BPJJTnr7p+I2bRZoBEA
+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-09-25 15:21:43
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:HD0m5hWYi/GXgz1rvk+Ipw
# You can replace this text with custom code or comments, and it will be preserved on regeneration
__PACKAGE__->set_primary_key("id");
-=head1 UNIQUE CONSTRAINTS
-
-=head2 C<index_name_2>
-
-=over 4
-
-=item * L</index_name>
-
-=item * L</marc_type>
-
-=item * L</marc_field>
-
-=back
-
-=cut
-
-__PACKAGE__->add_unique_constraint("index_name_2", ["index_name", "marc_type", "marc_field"]);
-
=head1 RELATIONS
=head2 search_marc_to_fields
__PACKAGE__->many_to_many("search_fields", "search_marc_to_fields", "search_field");
-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-09-01 16:56:47
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Vo1uboO+iKCunqfpetswDg
+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-09-25 15:20:52
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:o579otqUGA8XhO+NYv99dw
# You can replace this text with custom code or comments, and it will be preserved on regeneration
"search_marc_map",
"Koha::Schema::Result::SearchMarcMap",
{ id => "search_marc_map_id" },
- { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" },
+ { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
);
-# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-06-10 14:32:07
-# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZNdjnjdGpK+5P478RkCWnA
+# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-09-25 15:19:43
+# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:h9oY2xOGibcnsriEfcFe8A
# You can replace this text with custom code or comments, and it will be preserved on regeneration
SetVersion($DBversion);
}
+$DBversion = "XXX";
+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
+ $dbh->do(q|
+ ALTER TABLE search_marc_to_field DROP FOREIGN KEY search_marc_to_field_ibfk_1
+ |);
+ $dbh->do(q|
+ ALTER TABLE search_marc_to_field
+ ADD CONSTRAINT search_marc_to_field_ibfk_1 FOREIGN KEY (`search_marc_map_id`) REFERENCES `search_marc_map` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
+ |);
+ $dbh->do(q|
+ ALTER TABLE search_marc_map DROP KEY index_name_2
+ |);
+ $dbh->do(q|
+ ALTER TABLE search_field ADD COLUMN label VARCHAR(255) AFTER name
+ |);
+ $dbh->do(q|
+ UPDATE search_field SET label=name
+ |);
+
+ print "Upgrade to $DBversion done (Bug 12478/14899 - DB Changes to the elasticsearch tables)\n";
+ SetVersion($DBversion);
+}
+
# DEVELOPER PROCESS, search for anything to execute in the db_update directory
# SEE bug 13068
# if there is anything in the atomicupdate, read and execute it.