View | Details | Raw Unified | Return to bug 14899
Collapse All | Expand All

(-)a/Koha/Schema/Result/SearchField.pm (-2 / +10 lines)
Lines 37-42 __PACKAGE__->table("search_field"); Link Here
37
37
38
the name of the field as it will be stored in the search engine
38
the name of the field as it will be stored in the search engine
39
39
40
=head2 label
41
42
  data_type: 'varchar'
43
  is_nullable: 1
44
  size: 255
45
40
=head2 type
46
=head2 type
41
47
42
  data_type: 'enum'
48
  data_type: 'enum'
Lines 52-57 __PACKAGE__->add_columns( Link Here
52
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
58
  { data_type => "integer", is_auto_increment => 1, is_nullable => 0 },
53
  "name",
59
  "name",
54
  { data_type => "varchar", is_nullable => 0, size => 255 },
60
  { data_type => "varchar", is_nullable => 0, size => 255 },
61
  "label",
62
  { data_type => "varchar", is_nullable => 1, size => 255 },
55
  "type",
63
  "type",
56
  {
64
  {
57
    data_type => "enum",
65
    data_type => "enum",
Lines 114-121 Composing rels: L</search_marc_to_fields> -> search_marc_map Link Here
114
__PACKAGE__->many_to_many("search_marc_maps", "search_marc_to_fields", "search_marc_map");
122
__PACKAGE__->many_to_many("search_marc_maps", "search_marc_to_fields", "search_marc_map");
115
123
116
124
117
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-09-01 16:56:47
125
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-09-25 15:21:43
118
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:VN1BPJJTnr7p+I2bRZoBEA
126
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:HD0m5hWYi/GXgz1rvk+Ipw
119
127
120
128
121
# You can replace this text with custom code or comments, and it will be preserved on regeneration
129
# You can replace this text with custom code or comments, and it will be preserved on regeneration
(-)a/Koha/Schema/Result/SearchMarcMap.pm (-20 / +2 lines)
Lines 115-138 __PACKAGE__->add_columns( Link Here
115
115
116
__PACKAGE__->set_primary_key("id");
116
__PACKAGE__->set_primary_key("id");
117
117
118
=head1 UNIQUE CONSTRAINTS
119
120
=head2 C<index_name_2>
121
122
=over 4
123
124
=item * L</index_name>
125
126
=item * L</marc_type>
127
128
=item * L</marc_field>
129
130
=back
131
132
=cut
133
134
__PACKAGE__->add_unique_constraint("index_name_2", ["index_name", "marc_type", "marc_field"]);
135
136
=head1 RELATIONS
118
=head1 RELATIONS
137
119
138
=head2 search_marc_to_fields
120
=head2 search_marc_to_fields
Lines 161-168 Composing rels: L</search_marc_to_fields> -> search_field Link Here
161
__PACKAGE__->many_to_many("search_fields", "search_marc_to_fields", "search_field");
143
__PACKAGE__->many_to_many("search_fields", "search_marc_to_fields", "search_field");
162
144
163
145
164
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-09-01 16:56:47
146
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-09-25 15:20:52
165
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:Vo1uboO+iKCunqfpetswDg
147
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:o579otqUGA8XhO+NYv99dw
166
148
167
149
168
# You can replace this text with custom code or comments, and it will be preserved on regeneration
150
# You can replace this text with custom code or comments, and it will be preserved on regeneration
(-)a/Koha/Schema/Result/SearchMarcToField.pm (-3 / +3 lines)
Lines 87-98 __PACKAGE__->belongs_to( Link Here
87
  "search_marc_map",
87
  "search_marc_map",
88
  "Koha::Schema::Result::SearchMarcMap",
88
  "Koha::Schema::Result::SearchMarcMap",
89
  { id => "search_marc_map_id" },
89
  { id => "search_marc_map_id" },
90
  { is_deferrable => 1, on_delete => "RESTRICT", on_update => "RESTRICT" },
90
  { is_deferrable => 1, on_delete => "CASCADE", on_update => "CASCADE" },
91
);
91
);
92
92
93
93
94
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-06-10 14:32:07
94
# Created by DBIx::Class::Schema::Loader v0.07042 @ 2015-09-25 15:19:43
95
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:ZNdjnjdGpK+5P478RkCWnA
95
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:h9oY2xOGibcnsriEfcFe8A
96
96
97
97
98
# You can replace this text with custom code or comments, and it will be preserved on regeneration
98
# You can replace this text with custom code or comments, and it will be preserved on regeneration
(-)a/installer/data/mysql/updatedatabase.pl (-1 / +23 lines)
Lines 10955-10960 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
10955
    SetVersion($DBversion);
10955
    SetVersion($DBversion);
10956
}
10956
}
10957
10957
10958
$DBversion = "XXX";
10959
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
10960
    $dbh->do(q|
10961
        ALTER TABLE search_marc_to_field DROP FOREIGN KEY search_marc_to_field_ibfk_1
10962
    |);
10963
    $dbh->do(q|
10964
        ALTER TABLE search_marc_to_field
10965
        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
10966
    |);
10967
    $dbh->do(q|
10968
        ALTER TABLE search_marc_map DROP KEY index_name_2
10969
    |);
10970
    $dbh->do(q|
10971
        ALTER TABLE search_field ADD COLUMN label VARCHAR(255) AFTER name
10972
    |);
10973
    $dbh->do(q|
10974
        UPDATE search_field SET label=name
10975
    |);
10976
10977
    print "Upgrade to $DBversion done (Bug 12478/14899 - DB Changes to the elasticsearch tables)\n";
10978
    SetVersion($DBversion);
10979
}
10980
10958
# DEVELOPER PROCESS, search for anything to execute in the db_update directory
10981
# DEVELOPER PROCESS, search for anything to execute in the db_update directory
10959
# SEE bug 13068
10982
# SEE bug 13068
10960
# if there is anything in the atomicupdate, read and execute it.
10983
# if there is anything in the atomicupdate, read and execute it.
10961
- 

Return to bug 14899