From 75160b12821f7f4299cce7f0b69c83c1502ae071 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Anton=20Luka=20=C5=A0ijanec?= <anton@sijanec.eu>
Date: Mon, 27 May 2024 13:08:29 +0200
Subject: 2024-02-19 upstream

---
 sql/update2.sql | 362 +++++++++++++++++++++++++++++++++++++++++++++++++++++++-
 1 file changed, 361 insertions(+), 1 deletion(-)

(limited to 'sql/update2.sql')

diff --git a/sql/update2.sql b/sql/update2.sql
index 9706857..470cb9b 100644
--- a/sql/update2.sql
+++ b/sql/update2.sql
@@ -7740,7 +7740,7 @@ ALTER TABLE srv_anketa ADD mobile_created ENUM('0','1') NOT NULL DEFAULT '0';
 UPDATE misc SET value='16.08.29' WHERE what="version";
 
 INSERT INTO srv_help (help, what) VALUES ('Z izbiro "email vabil z individualiziranim URL" se avtomati&#269;no vklopi opcija "Da" za individualizirana vabila, za vnos kode pa "Avtomatsko v URL". Respondentom bo sistem 1KA lahko poslal email, v katerem bo individualiziran URL naslovom ankete. &#268;im bo respondent na URL kliknil, bo sistem 1KA sledil respondenta.', 'srv_inv_activate_1');
-INSERT INTO srv_help (help, what) VALUES ('INSERT INTO srv_anketa_module (ank_id, modul) SELECT id, 'quiz' FROM srv_anketa WHERE quiz='1';Z izbiro "ro&#269;ni vnos individualizirane kode" se avtomati&#269;no vklopi opcija "Da" za individulaizirana vabila ter opcija "Ro&#269;ni vnos" za vnos kode. Respondenti bodo prejeli enak URL, na za&#269;etku pa bodo morali ro&#269;no vnesti svojo individualno kodo. Vabilo s kodo se lahko respondentu po&#353;lje z emailom preko sistemom 1KA. Lahko pa se po&#353;lje  tudi eksterno (izven sistema 1KA): z dopisom preko po&#353;te, s SMS sporo&#269;ilom kako druga&#269;e; v takem primeru sistem 1KA zgolj zabele&#382;i kdo, kdaj in kako je poslal vabilo.', 'srv_inv_activate_2');
+INSERT INTO srv_help (help, what) VALUES ('Z izbiro "ro&#269;ni vnos individualizirane kode" se avtomati&#269;no vklopi opcija "Da" za individulaizirana vabila ter opcija "Ro&#269;ni vnos" za vnos kode. Respondenti bodo prejeli enak URL, na za&#269;etku pa bodo morali ro&#269;no vnesti svojo individualno kodo. Vabilo s kodo se lahko respondentu po&#353;lje z emailom preko sistemom 1KA. Lahko pa se po&#353;lje  tudi eksterno (izven sistema 1KA): z dopisom preko po&#353;te, s SMS sporo&#269;ilom kako druga&#269;e; v takem primeru sistem 1KA zgolj zabele&#382;i kdo, kdaj in kako je poslal vabilo.', 'srv_inv_activate_2');
 INSERT INTO srv_help (help, what) VALUES ('Z izbiro "uporabe splo&#353;nih vabil brez individulaizirane kode" opcija "email vabila z individualiziranim URL" ostaja izklopljena ("Ne"). Sistem 1KA bo respondenom lahko poslal emaile, ki pa ne bo imeli individulaizranega URL oziroma individualizirane kode.', 'srv_inv_activate_3');
 
 UPDATE misc SET value='16.09.02' WHERE what="version";
@@ -9499,3 +9499,363 @@ UPDATE misc SET value='21.05.24' WHERE what="version";
 INSERT INTO srv_help (help, what) VALUES ('Operatorji', 'srv_if_operator');
 
 UPDATE misc SET value='21.05.25' WHERE what="version";
+
+# Drupal verzija je bila posodobljena in vpišemo na 1ka.si in te
+UPDATE misc SET value='7.81' WHERE what="drupal version";
+UPDATE misc SET value='21.06.10' WHERE what="version";
+
+INSERT INTO srv_help (what, help) VALUES ('srv_export_full_meta', 'Export data and paradata');
+
+UPDATE srv_help SET help='Izvozi podatke in parapodatke' WHERE what='srv_export_full_meta' AND lang='1';
+INSERT INTO srv_help (what, help, lang) VALUES ('srv_export_full_meta', 'Export data and paradata', '2');
+
+UPDATE misc SET value='21.07.19' WHERE what="version";
+
+# NOVE ARHIVSKE TABELE - STARE SO PREIMENOVANE IN DODANE DODATNE
+RENAME TABLE srv_data_vrednost TO srv_data_vrednost_archive1;
+RENAME TABLE srv_data_text TO srv_data_text_archive1;
+RENAME TABLE srv_data_grid TO srv_data_grid_archive1;
+RENAME TABLE srv_data_checkgrid TO srv_data_checkgrid_archive1;
+RENAME TABLE srv_data_textgrid TO srv_data_textgrid_archive1;
+RENAME TABLE srv_user_grupa TO srv_user_grupa_archive1;
+RENAME TABLE srv_tracking TO srv_tracking_archive1;
+
+CREATE TABLE srv_data_vrednost_archive2 LIKE srv_data_vrednost_archive1; 
+CREATE TABLE srv_data_text_archive2 LIKE srv_data_text_archive1; 
+CREATE TABLE srv_data_grid_archive2 LIKE srv_data_grid_archive1; 
+CREATE TABLE srv_data_checkgrid_archive2 LIKE srv_data_checkgrid_archive1; 
+CREATE TABLE srv_data_textgrid_archive2 LIKE srv_data_textgrid_archive1; 
+CREATE TABLE srv_user_grupa_archive2 LIKE srv_user_grupa_archive1; 
+CREATE TABLE srv_tracking_archive2 LIKE srv_tracking_archive1; 
+
+UPDATE misc SET value='21.07.23' WHERE what="version";
+
+ALTER TABLE srv_language_vrednost CHANGE naslov2 naslov2 TEXT character set utf8 NOT NULL;
+ALTER TABLE srv_language_spremenljivka CHANGE info info TEXT character set utf8 NOT NULL;
+
+UPDATE misc SET value='21.07.29' WHERE what="version";
+
+## AAI ID uporabnika - SAMO NA AAI instalaciji!!!
+##ALTER TABLE users ADD aai_id VARCHAR(255) CHARACTER SET utf8 NOT NULL DEFAULT '' AFTER email;
+
+UPDATE misc SET value='21.08.30' WHERE what="version";
+
+## Moramo refreshati seznam mojih anket, ker ne prikazujemo vec stevila vseh responsov ampak samo veljavnih
+UPDATE srv_survey_list SET updated='1';
+
+UPDATE misc SET value='21.09.20' WHERE what="version";
+
+## Ciscenje tabele "misc"
+DELETE FROM misc WHERE NOT (
+    what LIKE '%version%'
+    OR what LIKE '%drupal version%'
+    OR what LIKE '%mobileApp_version%'
+    OR what LIKE '%SurveyLang_admin%'
+    OR what LIKE '%SurveyLang_resp%'
+    OR what LIKE '%SurveyDostop%'
+    OR what LIKE '%SurveyForum%'
+    OR what LIKE '%SurveyCookie%'
+    OR what LIKE '%CookieLife%'
+);
+
+## !!!!!!! PO SPODNJEM UPDATU JE NUJNO POGNATI SKRIPTO v utils/1kaUtils/app_settings_copy.php, ki prekopira vse spremenljivke v bazo !!!!!!!!
+## Nova tabela z nastavitvami aplikacije - SEM SE PRENESE VSE IZ settings_optional.php
+CREATE TABLE app_settings(
+    what VARCHAR(100) CHARACTER SET utf8 NOT NULL DEFAULT '',
+    domain VARCHAR(100) CHARACTER SET utf8 NOT NULL DEFAULT '',
+    value TEXT CHARACTER SET utf8 NOT NULL DEFAULT '',
+    UNIQUE KEY (what, domain)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+UPDATE misc SET value='21.09.21' WHERE what="version";
+
+## Ankete vec ne stevilcimo ampak jih identificiramo po hashu
+ALTER TABLE srv_anketa ADD hash VARCHAR(8) CHARACTER SET utf8 NOT NULL DEFAULT '' AFTER id;
+
+## Stare ankete imajo za hash kar id (da je kompatibilno za nazaj ker so ze objavljene)
+UPDATE srv_anketa SET hash=id;
+
+ALTER TABLE srv_anketa ADD UNIQUE (hash);
+
+UPDATE misc SET value='22.09.30' WHERE what="version";
+
+INSERT INTO srv_help (what, help) VALUES ('srv_glasovanje_archive', 'Dodaj anketo v arhiv glasovanja');
+
+UPDATE misc SET value='21.11.16' WHERE what="version";
+
+## !!!!! Uvozi sql/srv_help_new.sql datoteko za nove help vprasajcke
+
+ALTER TABLE srv_notifications_messages CHANGE date send_time DATETIME(3) NOT NULL AFTER author;
+
+UPDATE misc SET value='22.03.31' WHERE what="version";
+
+ALTER TABLE srv_data_upload CHANGE filename filename VARCHAR(50) character set utf8 NOT NULL;
+
+UPDATE misc SET value='22.06.14' WHERE what="version";
+
+## MODUL ZA KOLEKTOR
+INSERT INTO srv_module (module_name, active) VALUES ('kolektor', '0');
+#UPDATE srv_module SET active='1' WHERE module_name = 'kolektor';
+
+CREATE TABLE kolektor_survey(
+    id INT(11) NOT NULL auto_increment,
+    ank_id INT(11) NOT NULL DEFAULT '0',
+    survey_sequence ENUM('1','2','3','4','5','6') NOT NULL,
+    CONSTRAINT fk_kolektor_survey_ank_id FOREIGN KEY (ank_id) REFERENCES srv_anketa (id) ON DELETE CASCADE ON UPDATE CASCADE,
+    PRIMARY KEY (id)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE kolektor_survey_response(
+    id INT(11) NOT NULL auto_increment,
+    ank_id INT(11) NOT NULL DEFAULT 0,
+    usr_id INT(11) NOT NULL DEFAULT 0,
+    respondent_id INT(11) NOT NULL DEFAULT 0,
+    insert_time DATETIME(3) NOT NULL,
+    status ENUM('1','2','3','4','5') NOT NULL DEFAULT '1',
+    respondent_email VARCHAR(100) NOT NULL DEFAULT '',
+    respondent_funkcija VARCHAR(100) NOT NULL DEFAULT '',
+    respondent_projekt_id VARCHAR(100) NOT NULL DEFAULT '',
+    respondent_remote_activation ENUM('0','1') NOT NULL DEFAULT '0',
+    respondent_message TEXT NOT NULL DEFAULT '',
+    PRIMARY KEY (id),
+    UNIQUE KEY (respondent_id),
+    CONSTRAINT fk_kolektor_survey_response_ank_id FOREIGN KEY (ank_id) REFERENCES srv_anketa (id) ON DELETE CASCADE ON UPDATE CASCADE,
+    CONSTRAINT fk_kolektor_survey_response_usr_id FOREIGN KEY (usr_id) REFERENCES users (id) ON DELETE CASCADE ON UPDATE CASCADE,
+    CONSTRAINT fk_kolektor_survey_response_respondent_id FOREIGN KEY (respondent_id) REFERENCES srv_user (id) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE kolektor_survey_response_alert(
+    id INT(11) NOT NULL auto_increment,
+    respondent_id INT(11) NOT NULL DEFAULT 0,
+    alert_time DATETIME(3) NOT NULL,
+    new_status ENUM('0','1','2','3','4') NOT NULL,
+    PRIMARY KEY (id),
+    CONSTRAINT kolektor_survey_response_alert_respondent_id FOREIGN KEY (respondent_id) REFERENCES srv_user (id) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+CREATE TABLE kolektor_podjetje_funkcija(
+    id INT(11) NOT NULL auto_increment,
+    text VARCHAR(255) NOT NULL DEFAULT '',
+    order_number INT(11) NOT NULL DEFAULT 0,
+    PRIMARY KEY (id)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+UPDATE misc SET value='22.07.13' WHERE what="version";
+
+## FK za pobrisana vprasanja - po novem jih ne brisemo ampak ohranimo (podoben sistem kot knjiznica vprasanj)
+INSERT INTO srv_grupa (id, ank_id, naslov, vrstni_red) VALUES (-3, 0, 'system', 0);
+
+CREATE TABLE IF NOT EXISTS srv_spremenljivka_deleted (
+    id INT(11) NOT NULL auto_increment,
+    spr_id INT(11) NOT NULL,
+    ank_id INT(11) NOT NULL,
+    delete_time DATETIME(3) NOT NULL,
+    CONSTRAINT fk_srv_spremenljivka_deleted_ank_id FOREIGN KEY (ank_id) REFERENCES srv_anketa (id) ON DELETE CASCADE ON UPDATE CASCADE,
+    CONSTRAINT fk_srv_spremenljivka_deleted_spr_id FOREIGN KEY (spr_id) REFERENCES srv_spremenljivka (id) ON DELETE CASCADE ON UPDATE CASCADE,
+    PRIMARY KEY  (id)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+UPDATE misc SET value='22.08.05' WHERE what="version";
+
+INSERT INTO srv_misc (what, value) VALUES ('pc_tables', '0');
+
+UPDATE misc SET value='22.08.25' WHERE what="version";
+
+ALTER TABLE srv_mysurvey_folder ADD active enum('0','1') NOT NULL DEFAULT '0';
+
+UPDATE misc SET value='22.10.04' WHERE what="version";
+
+ALTER TABLE srv_mysurvey_folder ADD INDEX usr_id (usr_id);
+
+UPDATE misc SET value='22.10.05' WHERE what="version";
+
+## Dodamo polje za naslov vprasanja v knjiznici
+ALTER TABLE srv_spremenljivka ADD lib_naslov TEXT CHARACTER SET utf8 NOT NULL AFTER folder;
+UPDATE srv_spremenljivka SET lib_naslov=naslov WHERE gru_id='-1';
+
+UPDATE misc SET value='22.12.01' WHERE what="version";
+
+## Popravimo default vrednost prilagoditve tabel
+UPDATE srv_spremenljivka SET params=REPLACE(params, 'pc_tables=0', 'pc_tables=-1');
+UPDATE srv_spremenljivka SET params=REPLACE(params, 'mobile_tables=0', 'mobile_tables=-1');
+
+UPDATE misc SET value='22.12.04' WHERE what="version";
+
+INSERT INTO srv_help (what, help) VALUES ('srv_grid_width', 'Sirina podvprasanj');
+
+UPDATE misc SET value='22.12.09' WHERE what="version";
+
+## MODUL ZA PRENOS DOMENE www.1ka.si - vklop samo na www.1ka.si
+CREATE TABLE 1ka_domain_change_user(
+    id INT(11) NOT NULL auto_increment,
+    usr_id INT(11) NOT NULL DEFAULT 0,
+    switch_time DATETIME(3) NOT NULL,
+    switch_status ENUM('0','1','2') NOT NULL DEFAULT '0',
+    PRIMARY KEY (id),
+    UNIQUE KEY (usr_id),
+    CONSTRAINT fk_1ka_domain_change_user_usr_id FOREIGN KEY (usr_id) REFERENCES users (id) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+UPDATE misc SET value='22.12.13' WHERE what="version";
+
+## Modul za NIJZ porocilo na koncu ankete - samo na NIJZ instalaciji
+#INSERT INTO srv_anketa_module (ank_id, modul) VALUES ('127704', 'nijz_radar_report');
+#INSERT INTO srv_anketa_module (ank_id, modul) VALUES ('127858', 'nijz_radar_report');
+#INSERT INTO srv_anketa_module (ank_id, modul) VALUES ('128654', 'nijz_radar_report');
+#INSERT INTO srv_anketa_module (ank_id, modul) VALUES ('128660', 'nijz_radar_report');
+
+UPDATE misc SET value='23.01.06' WHERE what="version";
+
+CREATE TABLE srv_email_access (
+  id INT(11) NOT NULL auto_increment,
+	ank_id INT(11) NOT NULL DEFAULT 0,
+  email VARCHAR(100) NOT NULL DEFAULT '',
+  access_code VARCHAR(50) NOT NULL DEFAULT '',
+  status ENUM('0','1','2') NOT NULL DEFAULT '0',
+	PRIMARY KEY (id),
+  UNIQUE KEY (ank_id, email),
+  UNIQUE KEY (ank_id, access_code),
+	CONSTRAINT fk_srv_email_access_ank_id FOREIGN KEY (ank_id) REFERENCES srv_anketa (id) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+UPDATE misc SET value='23.02.27' WHERE what="version";
+
+INSERT INTO srv_help (what, lang, help) VALUES ('srv_alert_show_general', '1', 'Respondentu se prika&#382;e nevsebinski odgovor ("Ne vem", "Zavrnil", "Neustrezno" ipd.) &#353;ele po tem, ko ta ni odgovoril na vpra&#353;anje. Vpra&#353;anje mora biti obvezno, torej mora biti vklopljeno mehko ali trdo opozorilo.');
+INSERT INTO srv_help (what, lang, help) VALUES ('srv_alert_show_general', '2', 'Missing responses ("I don\'t know", "Refused", "Invalid", etc.) is shown to the respondent only after he has not answered the question. The question must be mandatory, i.e. a soft or hard reminder must be turned on.');
+
+UPDATE srv_help SET help='Pri vsakem vpra&#353;anju lahko nastavite:
+<UL>
+<LI>Mehko opozorilo: respondentu se bo pojavilo opozorilo da ni odgovoril na vpra&#353;anje, vendar pa mu za nadaljevanje ne bo potrebno odgovoriti.</LI>
+<LI>Trdo opozorilo: respondentu se pojavi opozorilo, da ni odgovoril na vpra&#353;anje. Za nadaljevanje mora obvezno odgovoriti na vsa vpra&#353;anja.</LI>
+</UL>' WHERE what='spremenljivka_reminder' AND lang='1';
+
+UPDATE srv_help SET help='For all survey questions you can set:
+<UL>
+<LI>Soft reminder: The respondent will be warned that he did not answer the question, but will not be required to answer.</LI>
+<LI>Hard reminder: The respondent is warned that he did not answer the question. He must answer all the questions in order to continue.</LI>
+</UL>' WHERE what='spremenljivka_reminder' AND lang='2';
+
+## "
+
+UPDATE misc SET value='23.03.03' WHERE what="version";
+
+ALTER TABLE srv_spremenljivka ADD alert_show_96 enum('0','1') NOT NULL DEFAULT '0' AFTER alert_show_97;
+
+UPDATE misc SET value='23.03.30' WHERE what="version";
+
+ALTER TABLE srv_email_access DROP INDEX ank_id_2;
+
+UPDATE misc SET value='23.04.03' WHERE what="version";
+
+CREATE TABLE srv_email_access_settings (
+	ank_id INT(11) NOT NULL,
+	captcha ENUM('0','1') NOT NULL DEFAULT '0',
+	terms_text TEXT CHARACTER SET utf8 NOT NULL,
+	PRIMARY KEY (ank_id),
+	CONSTRAINT fk_srv_email_access_settings_ank_id FOREIGN KEY (ank_id) REFERENCES srv_anketa (id) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+UPDATE misc SET value='23.04.11' WHERE what="version";
+
+## Nova tabela za belezenje aktivnosti ankete - belezimo samo prvo aktivacijo in zadnjo deaktivacijo
+CREATE TABLE srv_activity_new (
+  id INT(11) NOT NULL auto_increment,
+	sid INT(11) NOT NULL DEFAULT 0,
+  starts DATE NOT NULL DEFAULT '0000-00-00',
+	expire DATE NOT NULL DEFAULT '0000-00-00',
+	PRIMARY KEY (id),
+  UNIQUE KEY (sid),
+	CONSTRAINT fk_srv_activity_new_sid FOREIGN KEY (sid) REFERENCES srv_anketa (id) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE=InnoDB DEFAULT CHARSET=utf8;
+
+## Skopiramo vse aktivnosti v novo tabelo
+INSERT INTO srv_activity_new (sid, starts, expire) SELECT sid, MIN(starts), MAX(expire) FROM srv_activity GROUP BY sid;
+
+## Preimenujemo tabele, staro obdrzimo za vsak slucaj
+RENAME TABLE srv_activity TO srv_activity_old;
+RENAME TABLE srv_activity_new TO srv_activity;
+
+UPDATE misc SET value='23.04.17' WHERE what="version";
+
+ALTER TABLE srv_help ADD last_edit_time TIMESTAMP ON UPDATE CURRENT_TIMESTAMP DEFAULT CURRENT_TIMESTAMP;
+ALTER TABLE srv_help ADD last_edit_usr_id INT(11) NOT NULL DEFAULT 0;
+
+UPDATE misc SET value='23.04.24' WHERE what="version";
+
+ALTER TABLE srv_datasetting_profile CHANGE dovalues doValues ENUM('0','1') NOT NULL DEFAULT '0';
+
+UPDATE misc SET value='23.05.25' WHERE what="version";
+
+INSERT INTO srv_help (what, lang, help) VALUES ('archive_surveys', '1', 'Masovni izvoz ali uvoz anket uporabnika.');
+INSERT INTO srv_help (what, lang, help) VALUES ('archive_surveys', '2', 'Mass export or import of user surveys.');
+
+UPDATE misc SET value='23.06.20' WHERE what="version";
+
+## MODUL ZA AUTOMATICSERVIS
+INSERT INTO srv_module (module_name, active) VALUES ('automaticservis', '0');
+#UPDATE srv_module SET active='1' WHERE module_name = 'automaticservis';
+
+UPDATE misc SET value='23.08.22' WHERE what="version";
+
+## NOVO ARHIVIRANJE - samo na www.1ka.si izvedemo arhiviranje
+CREATE TABLE srv_data_vrednost_archive3 LIKE srv_data_vrednost_archive1; 
+CREATE TABLE srv_data_text_archive3 LIKE srv_data_text_archive1; 
+CREATE TABLE srv_data_grid_archive3 LIKE srv_data_grid_archive1; 
+CREATE TABLE srv_data_checkgrid_archive3 LIKE srv_data_checkgrid_archive1; 
+CREATE TABLE srv_data_textgrid_archive3 LIKE srv_data_textgrid_archive1; 
+CREATE TABLE srv_user_grupa_archive3 LIKE srv_user_grupa_archive1; 
+CREATE TABLE srv_tracking_archive3 LIKE srv_tracking_archive1; 
+
+UPDATE misc SET value='23.09.26' WHERE what="version";
+
+## Pobrisemo unique key v srv_invitations_recipients, ker ni potreben
+ALTER TABLE srv_invitations_recipients DROP FOREIGN KEY srv_invitations_recipients_ank_id;
+ALTER TABLE srv_invitations_recipients DROP INDEX ank_id_unique;
+ALTER TABLE srv_invitations_recipients ADD CONSTRAINT srv_invitations_recipients_ank_id FOREIGN KEY (ank_id) REFERENCES srv_anketa (id) ON DELETE CASCADE ON UPDATE CASCADE;
+
+UPDATE misc SET value='23.10.13' WHERE what="version";
+
+## Napredni modul kjer belezimo vse case po straneh in omogocimo napredni export
+INSERT INTO srv_module (module_name, active) VALUES ('advanced_timestamps', '0');
+# aktiviraj modul maza samo za www.1ka.si
+# UPDATE srv_module SET active='1' WHERE module_name = 'advanced_timestamps';
+
+CREATE TABLE srv_advanced_timestamps (
+  id INT(11) NOT NULL AUTO_INCREMENT,
+  gru_id INT(11) NOT NULL,
+  usr_id INT(11) NOT NULL,
+  time_edit DATETIME NOT NULL,
+  PRIMARY KEY (id),
+  CONSTRAINT fk_srv_advanced_timestamps_gru_id FOREIGN KEY (gru_id) REFERENCES srv_grupa (id) ON DELETE CASCADE ON UPDATE CASCADE,
+	CONSTRAINT fk_srv_advanced_timestamps_usr_id FOREIGN KEY (usr_id) REFERENCES srv_user (id) ON DELETE CASCADE ON UPDATE CASCADE
+) ENGINE = InnoDB DEFAULT CHARSET = utf8;
+
+UPDATE misc SET value='23.10.24' WHERE what="version";
+
+## Pobrisemo odvecne tabele, ki se ne uporabljajo
+DROP TABLE manager_clan;
+DROP TABLE registers;
+DROP TABLE clan;
+DROP TABLE manager;
+
+UPDATE misc SET value='23.12.11' WHERE what="version";
+
+## Popravimo se preostale tabele na InnoDB - pri velikih tabelah zna trajati!!!
+ALTER TABLE users_to_be ENGINE=InnoDB;
+ALTER TABLE fb_users ENGINE=InnoDB;
+ALTER TABLE oid_users ENGINE=InnoDB;
+ALTER TABLE misc ENGINE=InnoDB;
+ALTER TABLE forum ENGINE=InnoDB;
+ALTER TABLE post ENGINE=InnoDB;
+ALTER TABLE views ENGINE=InnoDB;
+
+UPDATE misc SET value='23.12.14' WHERE what="version";
+
+## Nimamo vec custom statusov po casih, tako da se tega ne rabi vec
+DROP TABLE srv_status_casi;
+
+UPDATE misc SET value='23.12.15' WHERE what="version";
+
+ALTER TABLE srv_calculation CHANGE number number FLOAT NOT NULL DEFAULT '0';
+
+UPDATE misc SET value='23.12.19' WHERE what="version";
-- 
cgit v1.2.3

