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 9877-9882 if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { Link Here
9877
    SetVersion($DBversion);
9877
    SetVersion($DBversion);
9878
}
9878
}
9879
9879
9880
$DBversion = "XXX";
9881
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
9882
    $dbh->do(q|
9883
        ALTER TABLE search_marc_to_field DROP FOREIGN KEY search_marc_to_field_ibfk_1
9884
    |);
9885
    $dbh->do(q|
9886
        ALTER TABLE search_marc_to_field
9887
        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
9888
    |);
9889
    $dbh->do(q|
9890
        ALTER TABLE search_marc_map DROP KEY index_name_2
9891
    |);
9892
    $dbh->do(q|
9893
        ALTER TABLE search_field ADD COLUMN label VARCHAR(255) AFTER name
9894
    |);
9895
    $dbh->do(q|
9896
        UPDATE search_field SET label=name
9897
    |);
9898
9899
    print "Upgrade to $DBversion done (Bug 12478 - set up elasticsearch tables)\n";
9900
    SetVersion($DBversion);
9901
}
9902
9880
=head1 FUNCTIONS
9903
=head1 FUNCTIONS
9881
9904
9882
=head2 TableExists($table)
9905
=head2 TableExists($table)
9883
- 

Return to bug 14899