aboutsummaryrefslogtreecommitdiffstats
path: root/mayor-orig/update/pre003734-1-mayor_naplo.sql
diff options
context:
space:
mode:
Diffstat (limited to 'mayor-orig/update/pre003734-1-mayor_naplo.sql')
-rw-r--r--mayor-orig/update/pre003734-1-mayor_naplo.sql23
1 files changed, 23 insertions, 0 deletions
diff --git a/mayor-orig/update/pre003734-1-mayor_naplo.sql b/mayor-orig/update/pre003734-1-mayor_naplo.sql
new file mode 100644
index 00000000..b04e4a6b
--- /dev/null
+++ b/mayor-orig/update/pre003734-1-mayor_naplo.sql
@@ -0,0 +1,23 @@
+DELIMITER $$
+DROP PROCEDURE IF EXISTS upgrade_database_3734 $$
+CREATE PROCEDURE upgrade_database_3734()
+BEGIN
+
+SET NAMES utf8 COLLATE utf8_hungarian_ci;
+
+IF EXISTS (
+ SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME='intezmeny' AND BINARY(COLUMN_NAME)='fenntartó'
+) THEN
+ alter table intezmeny drop column `fenntartó`;
+END IF;
+IF NOT EXISTS (
+ SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA=DATABASE() AND TABLE_NAME='intezmeny' AND BINARY(COLUMN_NAME)='fenntarto'
+) THEN
+ alter table intezmeny add column `fenntarto` enum('állami','egyházi','alapítványi','magán','egyéb') COLLATE utf8_hungarian_ci DEFAULT 'állami';
+END IF;
+
+END $$
+DELIMITER ;
+CALL upgrade_database_3734();
+
+