aboutsummaryrefslogtreecommitdiffstats
path: root/mayor-orig/update/pre003422-1-mayor_naplo.sql
blob: 9af5fa6a8c85698f5b9bbae49a41d23e6412226d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
DELIMITER $$
DROP PROCEDURE IF EXISTS upgrade_database_3422 $$
CREATE PROCEDURE upgrade_database_3422()
BEGIN
IF NOT EXISTS (
    SELECT * FROM information_schema.COLUMNS WHERE TABLE_SCHEMA='mayor_naplo' and TABLE_NAME='osztalyJelleg' AND COLUMN_NAME='osztalyJellegEles'
) THEN
    alter table osztalyJelleg add column osztalyJellegEles tinyint unsigned default 1;
END IF;
END $$
CALL upgrade_database_3422();
UPDATE osztalyJelleg SET osztalyJellegEles=1 WHERE osztalyJellegId>=21;
UPDATE osztalyJelleg SET osztalyJellegEles=0 WHERE osztalyJellegId<21;