aboutsummaryrefslogtreecommitdiffstats
path: root/mayor-orig/mayor-base/update/pre003760-1-mayor_login.sql
blob: e2fa02fc8219bfe072025fc238064f6843ea09e9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
DELIMITER $$
DROP PROCEDURE IF EXISTS upgrade_database_3760 $$
CREATE PROCEDURE upgrade_database_3760()
BEGIN
IF NOT EXISTS (
    SELECT * FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME='mayorKeychain'
) THEN
  CREATE TABLE `mayorKeychain` (
  `dt` date DEFAULT NULL,
  `OMKod` mediumint(8) unsigned zerofill NOT NULL DEFAULT '00000000',
  `publicKey` text COLLATE utf8_hungarian_ci NOT NULL,
  `valid` tinyint(1) unsigned NOT NULL DEFAULT '1',
  `naploUrl` varchar(255) COLLATE utf8_hungarian_ci NOT NULL,
  PRIMARY KEY (`OMKod`,`valid`)
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci;
ELSE
    IF NOT EXISTS (
	SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA=DATABASE() AND COLUMN_NAME='naploUrl'
    ) THEN
	ALTER TABLE mayorKeychain ADD `naploUrl` varchar(255) NOT NULL;
    END IF;
END IF;

END $$
DELIMITER ; $$
CALL upgrade_database_3760();

INSERT IGNORE INTO mayorKeychain (dt,OMKod,publicKey,valid,naploUrl)
VALUES (CURDATE(), '09862967','-----BEGIN PUBLIC KEY-----
MIGfMA0GCSqGSIb3DQEBAQUAA4GNADCBiQKBgQDbMFUWy0Juy/7uHROaLOMPSHMI
Vw/jSmEAKW6lCeIOH2oUVsAQkgsZCFiKqQhH3WbtLrAzSmOA7+rEU3RtgXtPZpHN
2UUPQqoHWoMOkumfIS5oM0sQgSQ738TC0X9yxZlNqZtdpdCa0zjVnGLxqVVhS3KD
+O8uuA7jQwczlSqWJwIDAQAB
-----END PUBLIC KEY-----',1,'https://www.mayor.hu');