
/* 08:18:16 gmspider gmspider */ ALTER TABLE `obchodny_partner_sluzba` DROP FOREIGN KEY `FK_obchodny_partner_typ_sluzby_typ_sluzby`;
/*1*/ ALTER TABLE `obchodny_partner_sluzba`
	CHANGE COLUMN `typ_sluzby_id` `sluzba_id` INT(11) UNSIGNED NULL DEFAULT NULL AFTER `obchodny_partner_id`,
	ADD COLUMN `na_dobu_neurcitu` TINYINT(1) NULL DEFAULT NULL AFTER `visibility_type`;

/*2*/ RENAME TABLE `typ_sluzby` TO `sluzba`;
/*3*/ ALTER TABLE `clanok_typ_sluzby`
	DROP FOREIGN KEY `FK_clanok_typ_sluzby_typ_sluzby`;
/*4*/ ALTER TABLE `clanok_typ_sluzby`
	ALTER `typ_sluzby_id` DROP DEFAULT;
/*5*/ ALTER TABLE `clanok_typ_sluzby`
	CHANGE COLUMN `typ_sluzby_id` `sluzba_id` INT(11) UNSIGNED NOT NULL AFTER `clanok_id`,
	ADD CONSTRAINT `FK_clanok_typ_sluzby_typ_sluzby` FOREIGN KEY (`sluzba_id`) REFERENCES `sluzba` (`id`);
/*6*/ RENAME TABLE `clanok_typ_sluzby` TO `clanok_sluzba`;
/*7*/ ALTER TABLE `smernica`
	DROP FOREIGN KEY `FK_smernica_typ_sluzby`;
/*8*/ ALTER TABLE `smernica`
	CHANGE COLUMN `typ_sluzby_id` `sluzba_id` INT(11) UNSIGNED NULL DEFAULT NULL AFTER `obchodny_partner_id`,
	ADD CONSTRAINT `FK_smernica_typ_sluzby` FOREIGN KEY (`sluzba_id`) REFERENCES `sluzba` (`id`);
/*9*/ ALTER TABLE `zamestnanec_obchodny_partner`
	CHANGE COLUMN `typ_sluzby_id` `sluzba_id` INT(11) UNSIGNED NULL DEFAULT NULL AFTER `obchodny_partner_id`;
/*10*/ UPDATE `menu` SET `nazov`='Pridanide služby' WHERE  `id`=101;
/*11*/ UPDATE `menu` SET `nazov`='Zmazanie služby' WHERE  `id`=102;
/*12*/ UPDATE `menu` SET `nazov`='Editovanie služby' WHERE  `id`=103;
/*13*/ INSERT INTO `form_element` (`id`, `form_group_id`, `form_element_type_id`, `db_table`, `db_column`, `column_title`, `position`, `direct_to_db`) VALUES (34, 2, 3, 'obchodny_partner_sluzba', 'na_dobu_neurcitu', 'Na dobu neurčitú', 40, 1);
/*14*/ UPDATE `form_element` SET `position`=50, `required`=NULL WHERE  `id`=6;
/*15*/ UPDATE `sluzba` SET `nazov`='GM Spider - Správa majetku' WHERE  `id`=7;
/*16*/ UPDATE `sluzba` SET `nazov`='GM Spider - Plánovanie' WHERE  `id`=8;
/*17*/ UPDATE `sluzba` SET `nazov`='GM Spider - Zákazník' WHERE  `id`=9;
/*18*/ CREATE TABLE `osoba_modul` (
	`osoba_id` INT(11) UNSIGNED NOT NULL,
	`modul_id` INT(11) UNSIGNED NOT NULL,
	PRIMARY KEY (`osoba_id`, `modul_id`)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB
;
/*19*/ ALTER TABLE `osoba_modul`
	ADD CONSTRAINT `osoba_id` FOREIGN KEY (`osoba_id`) REFERENCES `osoba` (`id`),
	ADD CONSTRAINT `modul_id` FOREIGN KEY (`modul_id`) REFERENCES `modul` (`id`);
/*20*/ INSERT INTO `form_element` (`id`, `form_group_id`, `form_element_type_id`, `db_table`, `db_column`, `column_title`, `position`, `direct_to_db`, `css_class`, `direct_multi_label`, `direct_multi_data`) VALUES (35, 5, 9, 'osoba', 'modul', 'Modul', 10, 1, 'select2', 1, 1);
/*21*/ UPDATE `form_element` SET `db_column`='modul_id', `db_multi_table`='modul' WHERE  `id`=35;
/*22*/ UPDATE `form_element` SET `column_title`='Práva' WHERE  `id`=35;
/*23*/ UPDATE `form_element` SET `position`=20 WHERE  `id`=35;
/*24*/ UPDATE `form_element` SET `position`=30 WHERE  `id`=11;
/*26*/ UPDATE `form_group` SET `nazov`='Prístup' WHERE  `id`=5;
/*27*/ UPDATE `form_element` SET `column_title`='Zmena hesla', `position`=30 WHERE  `id`=11;