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

(-)a/installer/data/mysql/atomicupdate/bug_22343_smtp_servers.perl (+29 lines)
Line 0 Link Here
1
$DBversion = 'XXX';
2
if( CheckVersion( $DBversion ) ) {
3
4
    unless (TableExists('smtp_servers')) {
5
6
        # Create the table
7
        $dbh->do(q{
8
            CREATE TABLE `smtp_servers` (
9
                `id` INT(11) NOT NULL AUTO_INCREMENT,
10
                `name` VARCHAR(80) NOT NULL,
11
                `library_id` VARCHAR(10) NULL DEFAULT NULL,
12
                `host` VARCHAR(80) NOT NULL DEFAULT 'localhost',
13
                `port` INT(11) NOT NULL DEFAULT 25,
14
                `timeout` INT(11) NOT NULL DEFAULT 120,
15
                `ssl_mode` ENUM('disabled', 'ssl', 'starttls') NOT NULL,
16
                `user_name` VARCHAR(80) NULL DEFAULT NULL,
17
                `password` VARCHAR(80) NULL DEFAULT NULL,
18
                `debug` TINYINT(1) NOT NULL DEFAULT 0,
19
                PRIMARY KEY (`id`),
20
                UNIQUE KEY `library_id_idx` (`library_id`),
21
                KEY `host_idx` (`host`),
22
                CONSTRAINT `library_id_fk` FOREIGN KEY (`library_id`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE
23
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
24
        });
25
    }
26
27
    # Always end with this (adjust the bug info)
28
    NewVersion( $DBversion, 22343, "Add SMTP configuration options");
29
}
(-)a/installer/data/mysql/kohastructure.sql (-1 / +31 lines)
Lines 4570-4575 CREATE TABLE advanced_editor_macros ( Link Here
4570
    CONSTRAINT borrower_macro_fk FOREIGN KEY ( borrowernumber ) REFERENCES borrowers ( borrowernumber ) ON UPDATE CASCADE ON DELETE CASCADE
4570
    CONSTRAINT borrower_macro_fk FOREIGN KEY ( borrowernumber ) REFERENCES borrowers ( borrowernumber ) ON UPDATE CASCADE ON DELETE CASCADE
4571
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4571
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4572
4572
4573
--
4574
-- Table structure for table advanced_editor_macros
4575
--
4576
4577
DROP TABLE IF EXISTS `smtp_servers`;
4578
CREATE TABLE `smtp_servers` (
4579
    `id` INT(11) NOT NULL AUTO_INCREMENT,
4580
    -- Unique ID of the server
4581
    `name` VARCHAR(80) NOT NULL,
4582
    -- Name of the SMTP server
4583
    `library_id` VARCHAR(10) NULL DEFAULT NULL,
4584
    -- Internal identifier for the library using it. NULL means global
4585
    `host` VARCHAR(80) NOT NULL DEFAULT 'localhost',
4586
    -- FQDN for the SMTP server
4587
    `port` INT(11) NOT NULL DEFAULT 25,
4588
    -- TCP port number
4589
    `timeout` INT(11) NOT NULL DEFAULT 120,
4590
    -- Maximum time in secs to wait for server
4591
    `ssl_mode` ENUM('disabled', 'ssl', 'starttls') NOT NULL,
4592
    -- If STARTTLS needs to be issued
4593
    `user_name` VARCHAR(80) NULL DEFAULT NULL,
4594
    -- The username to use for auth; optional
4595
    `password` VARCHAR(80) NULL DEFAULT NULL,
4596
    -- The password to use for auth; required if username is provided
4597
    `debug` TINYINT(1) NOT NULL DEFAULT 0,
4598
    PRIMARY KEY (`id`),
4599
    UNIQUE KEY `library_id_idx` (`library_id`),
4600
    KEY `host_idx` (`host`),
4601
    CONSTRAINT `library_id_fk` FOREIGN KEY (`library_id`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE
4602
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
4603
4573
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
4604
/*!40103 SET TIME_ZONE=@OLD_TIME_ZONE */;
4574
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
4605
/*!40101 SET SQL_MODE=@OLD_SQL_MODE */;
4575
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
4606
/*!40014 SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS */;
4576
- 

Return to bug 22343