diff options
author | M.Gergo | 2021-02-20 03:22:41 +0100 |
---|---|---|
committer | M.Gergo | 2021-02-20 03:22:41 +0100 |
commit | e472633f696d7e913b36875b258f4d45167388cc (patch) | |
tree | e91387703cbcca7835f452d162fb27a4eac8ab50 /mayor-orig/mayor-portal/update | |
parent | cf6a58003f47139501a2907f8a4bc400b23fda66 (diff) | |
parent | fb24a50c54d5776468e49def08aea44c4077eb47 (diff) | |
download | mayor-e472633f696d7e913b36875b258f4d45167388cc.tar.gz mayor-e472633f696d7e913b36875b258f4d45167388cc.zip |
Az eredeti forráskódok frissítve a http://mayor.hu -ról
Diffstat (limited to 'mayor-orig/mayor-portal/update')
-rw-r--r-- | mayor-orig/mayor-portal/update/rev004693-1-mayor_portal.sql | 32 | ||||
-rw-r--r-- | mayor-orig/mayor-portal/update/rev004710-1-mayor_portal.sql | 12 |
2 files changed, 44 insertions, 0 deletions
diff --git a/mayor-orig/mayor-portal/update/rev004693-1-mayor_portal.sql b/mayor-orig/mayor-portal/update/rev004693-1-mayor_portal.sql new file mode 100644 index 00000000..5b36028d --- /dev/null +++ b/mayor-orig/mayor-portal/update/rev004693-1-mayor_portal.sql @@ -0,0 +1,32 @@ +DELIMITER $$ +DROP PROCEDURE IF EXISTS upgrade_database_4693 $$ + +CREATE PROCEDURE upgrade_database_4693() +BEGIN +SET NAMES utf8 COLLATE utf8_hungarian_ci; + +IF NOT EXISTS (SELECT * FROM information_schema.STATISTICS WHERE TABLE_SCHEMA=DATABASE() and TABLE_NAME='kategoriak' AND COLUMN_NAME='id') THEN + ALTER TABLE `kategoriak` ADD UNIQUE INDEX (id); +END IF; + +ALTER TABLE `hirek` ENGINE = InnoDB; +ALTER TABLE `kategoriak` ENGINE = InnoDB; + +IF NOT EXISTS (SELECT * FROM information_schema.TABLES WHERE TABLE_SCHEMA=DATABASE() and TABLE_NAME='hirKategoria') THEN +CREATE TABLE `hirKategoria` ( + `hirId` int(10) unsigned NOT NULL, + `kategoriaId` mediumint(8) unsigned NOT NULL, + PRIMARY KEY (`hirId`,`kategoriaId`), + KEY `hirKategoria_FKIndex1` (`hirId`), + KEY `hirKategoria_FKIndex2` (`kategoriaId`), + CONSTRAINT `hirKategoria_ibfk_1` FOREIGN KEY (`hirId`) REFERENCES `hirek` (`id`) ON DELETE CASCADE ON UPDATE CASCADE, + CONSTRAINT `hirKategoria_ibfk_2` FOREIGN KEY (`kategoriaId`) REFERENCES `kategoriak` (`id`) ON DELETE CASCADE ON UPDATE CASCADE +) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_hungarian_ci ; +END IF; + +-- hirek.cid --> hirKategoria kapcsolo +INSERT IGNORE INTO hirKategoria SELECT hirek.id as hirId,hirek.cid AS kategoriaId from hirek where hirek.cid!=0; + +END $$ +DELIMITER ; +CALL upgrade_database_4693(); diff --git a/mayor-orig/mayor-portal/update/rev004710-1-mayor_portal.sql b/mayor-orig/mayor-portal/update/rev004710-1-mayor_portal.sql new file mode 100644 index 00000000..5ac98672 --- /dev/null +++ b/mayor-orig/mayor-portal/update/rev004710-1-mayor_portal.sql @@ -0,0 +1,12 @@ +DELIMITER $$ +DROP PROCEDURE IF EXISTS upgrade_database_4710 $$ + +CREATE PROCEDURE upgrade_database_4710() +BEGIN +SET NAMES utf8 COLLATE utf8_hungarian_ci; + +ALTER TABLE `hirek` MODIFY `owner` varchar(255) DEFAULT NULL; + +END $$ +DELIMITER ; +CALL upgrade_database_4710(); |