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

(-)a/installer/data/mysql/atomicupdate/bug_22343_smtp_servers.perl (+28 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`           TINYINT(1) NOT NULL DEFAULT 0,
16
                `user_name`     VARCHAR(80) NULL DEFAULT NULL,
17
                `password`      VARCHAR(80) NULL DEFAULT NULL,
18
                PRIMARY KEY (`id`),
19
                UNIQUE KEY `library_id_idx` (`library_id`),
20
                KEY `host_idx` (`host`),
21
                CONSTRAINT `library_id_fk` FOREIGN KEY (`library_id`) REFERENCES `branches` (`branchcode`) ON DELETE CASCADE ON UPDATE CASCADE
22
            ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
23
        });
24
    }
25
26
    # Always end with this (adjust the bug info)
27
    NewVersion( $DBversion, 22343, "Add SMTP configuration options");
28
}
(-)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
4579
CREATE TABLE `smtp_servers` (
4580
    `id` INT(11) NOT NULL AUTO_INCREMENT,
4581
    -- Unique ID of the server
4582
    `name` VARCHAR(80) NOT NULL,
4583
    -- Name of the SMTP server
4584
    `library_id` VARCHAR(10) NULL DEFAULT NULL,
4585
    -- Internal identifier for the library using it. NULL means global
4586
    `host` VARCHAR(80) NOT NULL DEFAULT 'localhost',
4587
    -- FQDN for the SMTP server
4588
    `port` INT(11) NOT NULL DEFAULT 25,
4589
    -- TCP port number
4590
    `timeout` INT(11) NOT NULL DEFAULT 120,
4591
    -- Maximum time in secs to wait for server
4592
    `ssl` TINYINT(1) NOT NULL DEFAULT 0,
4593
    -- If STARTTLS needs to be issued
4594
    `user_name` VARCHAR(80) NULL DEFAULT NULL,
4595
    -- The username to use for auth; optional
4596
    `password` VARCHAR(80) NULL DEFAULT NULL,
4597
    -- The password to use for auth; required if username is provided
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