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

(-)a/installer/data/mysql/atomicupdate/bug-23019.perl (-5 / +5 lines)
Lines 4-12 if( CheckVersion( $DBversion ) ) { Link Here
4
  # $dbh->do( "ALTER TABLE biblio ADD COLUMN badtaste int" );
4
  # $dbh->do( "ALTER TABLE biblio ADD COLUMN badtaste int" );
5
5
6
  # or perform some test and warn
6
  # or perform some test and warn
7
  if( !TableExists( 'import_batches_profile' ) ) {
7
  if( !TableExists( 'import_batch_profiles' ) ) {
8
    $dbh->do(q{
8
    $dbh->do(q{
9
      CREATE TABLE `import_batches_profile` ( -- profile for batches of marc records to be imported
9
      CREATE TABLE `import_batch_profiles` ( -- profile for batches of marc records to be imported
10
        `id` int(11) NOT NULL auto_increment, -- unique identifier and primary key
10
        `id` int(11) NOT NULL auto_increment, -- unique identifier and primary key
11
        `name` varchar(100) NOT NULL, -- name of this profile
11
        `name` varchar(100) NOT NULL, -- name of this profile
12
        `matcher_id` int(11) default NULL, -- the id of the match rule used (matchpoints.matcher_id)
12
        `matcher_id` int(11) default NULL, -- the id of the match rule used (matchpoints.matcher_id)
Lines 20-26 if( CheckVersion( $DBversion ) ) { Link Here
20
        `format` varchar(50) default NULL, -- marc format
20
        `format` varchar(50) default NULL, -- marc format
21
        `comments` LONGTEXT, -- any comments added when the file was uploaded
21
        `comments` LONGTEXT, -- any comments added when the file was uploaded
22
        PRIMARY KEY (`id`),
22
        PRIMARY KEY (`id`),
23
        UNIQUE KEY `u_import_batches_profile__name` (`name`)
23
        UNIQUE KEY `u_import_batch_profiles__name` (`name`)
24
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
24
      ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci
25
    });
25
    });
26
  }
26
  }
Lines 31-40 if( CheckVersion( $DBversion ) ) { Link Here
31
    });
31
    });
32
32
33
    $dbh->do(q{
33
    $dbh->do(q{
34
      ALTER TABLE import_batches ADD CONSTRAINT `import_batches_ibfk_1` FOREIGN KEY (`profile_id`) REFERENCES `import_batches_profile` (`id`) ON DELETE SET NULL ON UPDATE SET NULL
34
      ALTER TABLE import_batches ADD CONSTRAINT `import_batches_ibfk_1` FOREIGN KEY (`profile_id`) REFERENCES `import_batch_profiles` (`id`) ON DELETE SET NULL ON UPDATE SET NULL
35
    });
35
    });
36
  }
36
  }
37
37
38
  # Always end with this (adjust the bug info)
38
  # Always end with this (adjust the bug info)
39
  NewVersion( $DBversion, 23019, "Add import_batches_profile table and profile_id column in import_batches");
39
  NewVersion( $DBversion, 23019, "Add import_batch_profiles table and profile_id column in import_batches");
40
}
40
}
(-)a/installer/data/mysql/kohastructure.sql (-6 / +5 lines)
Lines 701-711 CREATE TABLE `export_format` ( Link Here
701
) ENGINE=InnoDB  DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Used for CSV export';
701
) ENGINE=InnoDB  DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci COMMENT='Used for CSV export';
702
702
703
--
703
--
704
-- Table structure for table `import_batches_profile`
704
-- Table structure for table `import_batch_profiles`
705
--
705
--
706
706
707
DROP TABLE IF EXISTS `import_batches_profile`;
707
DROP TABLE IF EXISTS `import_batch_profiles`;
708
CREATE TABLE `import_batches_profile` ( -- profile for batches of marc records to be imported
708
CREATE TABLE `import_batch_profiles` ( -- profile for batches of marc records to be imported
709
  `id` int(11) NOT NULL auto_increment, -- unique identifier and primary key
709
  `id` int(11) NOT NULL auto_increment, -- unique identifier and primary key
710
  `name` varchar(100) NOT NULL, -- name of this profile
710
  `name` varchar(100) NOT NULL, -- name of this profile
711
  `matcher_id` int(11) default NULL, -- the id of the match rule used (matchpoints.matcher_id)
711
  `matcher_id` int(11) default NULL, -- the id of the match rule used (matchpoints.matcher_id)
Lines 719-725 CREATE TABLE `import_batches_profile` ( -- profile for batches of marc records t Link Here
719
  `format` varchar(50) default NULL, -- marc format
719
  `format` varchar(50) default NULL, -- marc format
720
  `comments` LONGTEXT, -- any comments added when the file was uploaded
720
  `comments` LONGTEXT, -- any comments added when the file was uploaded
721
  PRIMARY KEY (`id`),
721
  PRIMARY KEY (`id`),
722
  UNIQUE KEY `u_import_batches_profile__name` (`name`)
722
  UNIQUE KEY `u_import_batch_profiles__name` (`name`)
723
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
723
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
724
724
725
--
725
--
Lines 747-753 CREATE TABLE `import_batches` ( -- information about batches of marc records tha Link Here
747
  PRIMARY KEY (`import_batch_id`),
747
  PRIMARY KEY (`import_batch_id`),
748
  KEY `branchcode` (`branchcode`),
748
  KEY `branchcode` (`branchcode`),
749
  CONSTRAINT `import_batches_ibfk_1` FOREIGN KEY (`profile_id`)
749
  CONSTRAINT `import_batches_ibfk_1` FOREIGN KEY (`profile_id`)
750
  REFERENCES `import_batches_profile` (`id`) ON DELETE SET NULL ON UPDATE SET NULL
750
  REFERENCES `import_batch_profiles` (`id`) ON DELETE SET NULL ON UPDATE SET NULL
751
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
751
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
752
752
753
--
753
--
754
- 

Return to bug 23019