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

(-)a/installer/data/mysql/atomicupdate/bug_35761-add_SFTP_tables_and_perm.pl (+44 lines)
Line 0 Link Here
1
use Modern::Perl;
2
3
return {
4
    bug_number  => "35761",
5
    description => "Add new table and permission for generalised SFTP",
6
    up          => sub {
7
        my ($args) = @_;
8
        my ( $dbh, $out ) = @$args{qw(dbh out)};
9
10
        $dbh->do(
11
            q{
12
                INSERT IGNORE INTO permissions (module_bit, code, description)
13
                VALUES (3, 'manage_sftp_servers', 'Manage FTP/SFTP servers configuration');
14
            }
15
        );
16
        say $out "Added new manage_sftp_servers permission";
17
18
        unless ( TableExists('sftp_servers') ) {
19
            $dbh->do(
20
                q {
21
                    CREATE TABLE `sftp_servers` (
22
                    `id` int(11) NOT NULL AUTO_INCREMENT,
23
                    `name` varchar(80) NOT NULL,
24
                    `host` varchar(80) NOT NULL DEFAULT 'localhost',
25
                    `port` int(11) NOT NULL DEFAULT 22,
26
                    `transport` enum('ftp','sftp') NOT NULL DEFAULT 'sftp',
27
                    `passiv` tinyint(1) NOT NULL DEFAULT 1,
28
                    `user_name` varchar(80) DEFAULT NULL,
29
                    `password` mediumtext DEFAULT NULL,
30
                    `key_file` mediumtext DEFAULT NULL,
31
                    `auth_mode` enum('password','key_file','noauth') NOT NULL DEFAULT 'password',
32
                    `download_directory` mediumtext DEFAULT NULL,
33
                    `upload_directory` mediumtext DEFAULT NULL,
34
                    `status` varchar(32) DEFAULT NULL,
35
                    `debug` tinyint(1) NOT NULL DEFAULT 0,
36
                    PRIMARY KEY (`id`),
37
                    KEY `host_idx` (`host`)
38
                    ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
39
                }
40
            );
41
            say $out "Added new sftp_servers table";
42
        }
43
    },
44
};
(-)a/installer/data/mysql/kohastructure.sql (-1 / +27 lines)
Lines 5923-5928 CREATE TABLE `sessions` ( Link Here
5923
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
5923
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
5924
/*!40101 SET character_set_client = @saved_cs_client */;
5924
/*!40101 SET character_set_client = @saved_cs_client */;
5925
5925
5926
--
5927
-- Table structure for table `sftp_servers`
5928
--
5929
5930
DROP TABLE IF EXISTS `sftp_servers`;
5931
/*!40101 SET @saved_cs_client     = @@character_set_client */;
5932
/*!40101 SET character_set_client = utf8 */;
5933
CREATE TABLE `sftp_servers` (
5934
  `id` int(11) NOT NULL AUTO_INCREMENT,
5935
  `name` varchar(80) NOT NULL,
5936
  `host` varchar(80) NOT NULL DEFAULT 'localhost',
5937
  `port` int(11) NOT NULL DEFAULT 22,
5938
  `transport` enum('ftp','sftp') NOT NULL DEFAULT 'sftp',
5939
  `passiv` tinyint(1) NOT NULL DEFAULT 1,
5940
  `user_name` varchar(80) DEFAULT NULL,
5941
  `password` mediumtext DEFAULT NULL,
5942
  `key_file` mediumtext DEFAULT NULL,
5943
  `auth_mode` enum('password','key_file','noauth') NOT NULL DEFAULT 'password',
5944
  `download_directory` mediumtext DEFAULT NULL,
5945
  `upload_directory` mediumtext DEFAULT NULL,
5946
  `status` varchar(32) DEFAULT NULL,
5947
  `debug` tinyint(1) NOT NULL DEFAULT 0,
5948
  PRIMARY KEY (`id`),
5949
  KEY `host_idx` (`host`)
5950
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;
5951
/*!40101 SET character_set_client = @saved_cs_client */;
5952
5926
--
5953
--
5927
-- Table structure for table `sms_providers`
5954
-- Table structure for table `sms_providers`
5928
--
5955
--
5929
- 

Return to bug 35761