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

(-)a/installer/data/mysql/atomicupdate/bug_35104.pl (+29 lines)
Line 0 Link Here
1
use Modern::Perl;
2
use Koha::Installer::Output qw(say_warning say_success say_info);
3
4
return {
5
    bug_number  => "35104",
6
    description => "Add biblio_metadata_errors table for normalised error tracking",
7
    up          => sub {
8
        my ($args) = @_;
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
10
11
        unless ( TableExists('biblio_metadata_errors') ) {
12
            $dbh->do(
13
                q{
14
                    CREATE TABLE `biblio_metadata_errors` (
15
                        `id` int(11) NOT NULL AUTO_INCREMENT,
16
                        `metadata_id` int(11) NOT NULL COMMENT 'FK to biblio_metadata.id',
17
                        `error_type` varchar(64) NOT NULL COMMENT 'Error type identifier, e.g. nonxml_stripped',
18
                        `message` mediumtext DEFAULT NULL COMMENT 'Error message details',
19
                        `created_on` timestamp NOT NULL DEFAULT current_timestamp(),
20
                        PRIMARY KEY (`id`),
21
                        KEY `biblio_metadata_errors_fk_1` (`metadata_id`),
22
                        CONSTRAINT `biblio_metadata_errors_fk_1` FOREIGN KEY (`metadata_id`) REFERENCES `biblio_metadata` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
23
                    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
24
                }
25
            );
26
            say $out "Added new table 'biblio_metadata_errors'";
27
        }
28
    },
29
};
(-)a/installer/data/mysql/kohastructure.sql (-1 / +19 lines)
Lines 1159-1164 CREATE TABLE `biblio_metadata` ( Link Here
1159
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1159
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1160
/*!40101 SET character_set_client = @saved_cs_client */;
1160
/*!40101 SET character_set_client = @saved_cs_client */;
1161
1161
1162
--
1163
-- Table structure for table `biblio_metadata_errors`
1164
--
1165
1166
DROP TABLE IF EXISTS `biblio_metadata_errors`;
1167
/*!40101 SET @saved_cs_client     = @@character_set_client */;
1168
/*!40101 SET character_set_client = utf8mb4 */;
1169
CREATE TABLE `biblio_metadata_errors` (
1170
  `id` int(11) NOT NULL AUTO_INCREMENT,
1171
  `metadata_id` int(11) NOT NULL COMMENT 'FK to biblio_metadata.id',
1172
  `error_type` varchar(64) NOT NULL COMMENT 'Error type identifier, e.g. nonxml_stripped',
1173
  `message` mediumtext DEFAULT NULL COMMENT 'Error message details',
1174
  `created_on` timestamp NOT NULL DEFAULT current_timestamp(),
1175
  PRIMARY KEY (`id`),
1176
  KEY `biblio_metadata_errors_fk_1` (`metadata_id`),
1177
  CONSTRAINT `biblio_metadata_errors_fk_1` FOREIGN KEY (`metadata_id`) REFERENCES `biblio_metadata` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
1178
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
1179
/*!40101 SET character_set_client = @saved_cs_client */;
1180
1162
--
1181
--
1163
-- Table structure for table `biblioitems`
1182
-- Table structure for table `biblioitems`
1164
--
1183
--
1165
- 

Return to bug 35104