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

(-)a/Koha/Schema/Result/AuthorisedValue.pm (-2 / +18 lines)
Lines 90-95 __PACKAGE__->add_columns( Link Here
90
90
91
__PACKAGE__->set_primary_key("id");
91
__PACKAGE__->set_primary_key("id");
92
92
93
=head1 UNIQUE CONSTRAINTS
94
95
=head2 C<av_uniq>
96
97
=over 4
98
99
=item * L</category>
100
101
=item * L</authorised_value>
102
103
=back
104
105
=cut
106
107
__PACKAGE__->add_unique_constraint("av_uniq", ["category", "authorised_value"]);
108
93
=head1 RELATIONS
109
=head1 RELATIONS
94
110
95
=head2 authorised_values_branches
111
=head2 authorised_values_branches
Lines 108-115 __PACKAGE__->has_many( Link Here
108
);
124
);
109
125
110
126
111
# Created by DBIx::Class::Schema::Loader v0.07025 @ 2013-10-14 20:56:21
127
# Created by DBIx::Class::Schema::Loader v0.07039 @ 2014-08-05 16:05:45
112
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:N6Q7Y4sHL03X170zJ3APUA
128
# DO NOT MODIFY THIS OR ANYTHING ABOVE! md5sum:9LllSeL5DPjwR2ucEOqU8w
113
129
114
130
115
# You can replace this text with custom content, and it will be preserved on regeneration
131
# You can replace this text with custom content, and it will be preserved on regeneration
(-)a/installer/data/mysql/kohastructure.sql (+1 lines)
Lines 104-109 CREATE TABLE `authorised_values` ( -- stores values for authorized values catego Link Here
104
  `lib_opac` varchar(200) default NULL, -- authorized value description as printed in the OPAC
104
  `lib_opac` varchar(200) default NULL, -- authorized value description as printed in the OPAC
105
  `imageurl` varchar(200) default NULL, -- authorized value URL
105
  `imageurl` varchar(200) default NULL, -- authorized value URL
106
  PRIMARY KEY  (`id`),
106
  PRIMARY KEY  (`id`),
107
  UNIQUE KEY `av_uniq` (`category`,`authorised_value`),
107
  KEY `name` (`category`),
108
  KEY `name` (`category`),
108
  KEY `lib` (`lib`),
109
  KEY `lib` (`lib`),
109
  KEY `auth_value_idx` (`authorised_value`)
110
  KEY `auth_value_idx` (`authorised_value`)
(-)a/installer/data/mysql/updatedatabase.pl (-1 / +10 lines)
Lines 8589-8594 if ( CheckVersion($DBversion) ) { Link Here
8589
    SetVersion ($DBversion);
8589
    SetVersion ($DBversion);
8590
}
8590
}
8591
8591
8592
$DBversion = "3.17.00.XXX";
8593
if ( CheckVersion($DBversion) ) {
8594
    $dbh->do(q{
8595
        ALTER TABLE authorised_values ADD UNIQUE KEY av_uniq(category, authorised_value);
8596
    });
8597
    print "Upgrade to $DBversion done (Bug XXXXX: Add unique key on the authorised_values table)\n";
8598
    SetVersion($DBversion);
8599
}
8600
8601
8592
=head1 FUNCTIONS
8602
=head1 FUNCTIONS
8593
8603
8594
=head2 TableExists($table)
8604
=head2 TableExists($table)
8595
- 

Return to bug 10363