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

(-)a/installer/data/mysql/atomicupdate/bug_39837.pl (+25 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  => "39837",
6
    description => "Rename interface_id -> vendor_interface_id",
7
    up          => sub {
8
        my ($args) = @_;
9
        my ( $dbh, $out ) = @$args{qw(dbh out)};
10
11
        if ( TableExists('aqbookseller_interfaces') ) {
12
            if ( column_exists( 'aqbookseller_interfaces', 'interface_id' ) ) {
13
                $dbh->do(
14
                    q{
15
                        ALTER TABLE aqbookseller_interfaces RENAME COLUMN interface_id TO vendor_interface_id;
16
                    }
17
                );
18
                say_success(
19
                    $out,
20
                    q{Column 'aqbookseller_interfaces.interface_id' renamed to 'aqbookseller_interfaces.vendor_interface_id'}
21
                );
22
            }
23
        }
24
    },
25
};
(-)a/installer/data/mysql/kohastructure.sql (-3 / +2 lines)
Lines 435-441 DROP TABLE IF EXISTS `aqbookseller_interfaces`; Link Here
435
/*!40101 SET @saved_cs_client     = @@character_set_client */;
435
/*!40101 SET @saved_cs_client     = @@character_set_client */;
436
/*!40101 SET character_set_client = utf8mb4 */;
436
/*!40101 SET character_set_client = utf8mb4 */;
437
CREATE TABLE `aqbookseller_interfaces` (
437
CREATE TABLE `aqbookseller_interfaces` (
438
  `interface_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key and unique identifier assigned by Koha',
438
  `vendor_interface_id` int(11) NOT NULL AUTO_INCREMENT COMMENT 'primary key and unique identifier assigned by Koha',
439
  `vendor_id` int(11) NOT NULL COMMENT 'link to the vendor',
439
  `vendor_id` int(11) NOT NULL COMMENT 'link to the vendor',
440
  `type` varchar(80) DEFAULT NULL COMMENT 'type of the interface, authorised value VENDOR_INTERFACE_TYPE',
440
  `type` varchar(80) DEFAULT NULL COMMENT 'type of the interface, authorised value VENDOR_INTERFACE_TYPE',
441
  `name` varchar(255) NOT NULL COMMENT 'name of the interface',
441
  `name` varchar(255) NOT NULL COMMENT 'name of the interface',
Lines 444-450 CREATE TABLE `aqbookseller_interfaces` ( Link Here
444
  `password` mediumtext DEFAULT NULL COMMENT 'hashed password',
444
  `password` mediumtext DEFAULT NULL COMMENT 'hashed password',
445
  `account_email` mediumtext DEFAULT NULL COMMENT 'account email',
445
  `account_email` mediumtext DEFAULT NULL COMMENT 'account email',
446
  `notes` longtext DEFAULT NULL COMMENT 'notes',
446
  `notes` longtext DEFAULT NULL COMMENT 'notes',
447
  PRIMARY KEY (`interface_id`),
447
  PRIMARY KEY (`vendor_interface_id`),
448
  KEY `aqbookseller_interfaces_ibfk_1` (`vendor_id`),
448
  KEY `aqbookseller_interfaces_ibfk_1` (`vendor_id`),
449
  CONSTRAINT `aqbookseller_interfaces_ibfk_1` FOREIGN KEY (`vendor_id`) REFERENCES `aqbooksellers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
449
  CONSTRAINT `aqbookseller_interfaces_ibfk_1` FOREIGN KEY (`vendor_id`) REFERENCES `aqbooksellers` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
450
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
450
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
451
- 

Return to bug 39837