/*1*/ CREATE TABLE `zameranie_obchodneho_partnera` (
	`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
	`nazov` VARCHAR(45) NULL DEFAULT NULL,
	`visibility_type` TINYINT(1) NULL DEFAULT NULL,
	PRIMARY KEY (`id`)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB
;
/*2*/ CREATE TABLE `pocet_zamestnancov` (
	`id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT,
	`nazov` VARCHAR(45) NULL DEFAULT NULL,
	`od` INT(10) NULL DEFAULT 0,
		`do` INT(10) NULL DEFAULT 0,
	PRIMARY KEY (`id`)
)
COLLATE='utf8_general_ci'
ENGINE=InnoDB
;
/*4*/ ALTER TABLE `obchodny_partner`
	ADD COLUMN `zameranie_obchodneho_partnera_id` INT(10) UNSIGNED NULL DEFAULT NULL AFTER `visibility_type`,
	ADD COLUMN `pocet_zamestnancov_id` INT(10) UNSIGNED NULL DEFAULT NULL AFTER `zameranie_obchodneho_partnera_id`,
	ADD CONSTRAINT `FK_osoba_zameranie_obchodneho_partnera` FOREIGN KEY (`zameranie_obchodneho_partnera_id`) REFERENCES `zameranie_obchodneho_partnera` (`id`) ON UPDATE NO ACTION ON DELETE NO ACTION,
	ADD CONSTRAINT `FK_osoba_pocet_zamestnancov` FOREIGN KEY (`pocet_zamestnancov_id`) REFERENCES `pocet_zamestnancov` (`id`) ON UPDATE NO ACTION ON DELETE NO ACTION;
	
/*5*/ INSERT INTO `zameranie_obchodneho_partnera` (`id`, `nazov`, `visibility_type`) VALUES (1, 'Ubytovanie a gastronómia', 1);
/*6*/ INSERT INTO `zameranie_obchodneho_partnera` (`id`, `nazov`, `visibility_type`) VALUES (2, 'Kovovýroba', 1);
/*7*/ INSERT INTO `zameranie_obchodneho_partnera` (`id`, `nazov`, `visibility_type`) VALUES (3, 'Drevovýroba', 1);
/*8*/ INSERT INTO `zameranie_obchodneho_partnera` (`id`, `nazov`, `visibility_type`) VALUES (4, 'Skladovanie', 1);
/*9*/ INSERT INTO `zameranie_obchodneho_partnera` (`id`, `nazov`, `visibility_type`) VALUES (5, 'Štátna správa', 1);
/*10*/ INSERT INTO `zameranie_obchodneho_partnera` (`id`, `nazov`, `visibility_type`) VALUES (6, 'Potravinárska výroba', 1);
/*11*/ INSERT INTO `zameranie_obchodneho_partnera` (`id`, `nazov`, `visibility_type`) VALUES (7, 'Automobilová priemysel', 1);
/*12*/ INSERT INTO `zameranie_obchodneho_partnera` (`id`, `nazov`, `visibility_type`) VALUES (8, 'Stavebný priemysel', 1);
/*13*/ INSERT INTO `zameranie_obchodneho_partnera` (`id`, `nazov`, `visibility_type`) VALUES (9, 'Administratíva', 1);
/*14*/ INSERT INTO `zameranie_obchodneho_partnera` (`id`, `nazov`, `visibility_type`) VALUES (10, 'Zdravotnícke zariadenie', 1);
/*15*/ INSERT INTO `zameranie_obchodneho_partnera` (`id`, `nazov`, `visibility_type`) VALUES (11, 'Školské zariadenia', 1);
/*16*/ INSERT INTO `zameranie_obchodneho_partnera` (`id`, `nazov`, `visibility_type`) VALUES (12, 'Doprava', 1);
/*17*/ INSERT INTO `zameranie_obchodneho_partnera` (`id`, `nazov`, `visibility_type`) VALUES (13, 'Obchodné reťazce', 1);
/*18*/ INSERT INTO `zameranie_obchodneho_partnera` (`id`, `nazov`, `visibility_type`) VALUES (14, 'Poľnohospodárstvo', 1);
/*19*/ INSERT INTO `pocet_zamestnancov` (`id`, `nazov`, `do`) VALUES (1, 'do 10', 10);
/*20*/ INSERT INTO `pocet_zamestnancov` (`id`, `nazov`, `od`, `do`) VALUES (2, '10 až 25', 10, 25);
/*21*/ INSERT INTO `pocet_zamestnancov` (`id`, `nazov`, `od`, `do`) VALUES (3, '26 až 50', 26, 50);
/*22*/ INSERT INTO `pocet_zamestnancov` (`id`, `nazov`, `od`, `do`) VALUES (4, '51 až 100', 51, 100);
/*24*/ INSERT INTO `pocet_zamestnancov` (`id`, `nazov`, `od`, `do`) VALUES (5, '101 až 150', 101, 150);
/*25*/ INSERT INTO `pocet_zamestnancov` (`id`, `nazov`, `od`, `do`) VALUES (6, 'nad 150', 150, 99999);
/*26*/ INSERT INTO `form_element` (`id`, `form_group_id`, `form_element_type_id`, `db_table`, `db_column`, `db_multi_table`, `column_title`, `position`, `direct_to_db`, `direct_multi_label`, `add_empty_option`) VALUES (1, 26000, 5, 'obchodny_partner', 'zameranie_obchodneho_partnera_id', 'zameranie_obchodneho_partnera', 'Zameranie', 120, 1, 1, 1);
/*27*/ DELETE FROM `form_element` WHERE  `id`=26010;
/*28*/ INSERT INTO `form_element` (`id`, `form_group_id`, `form_element_type_id`, `db_table`, `db_column`, `db_multi_table`, `column_title`, `position`, `direct_to_db`, `direct_multi_label`, `add_empty_option`) VALUES (2, 26000, 5, 'obchodny_partner', 'pocet_zamestnancov_id', 'pocet_zamestnancov', 'Počet zamestnancov', 130, 1, 1, 1);
/*29*/ INSERT INTO `form_group` (`id`, `form_id`, `nazov`, `code`, `position`) VALUES (1, 260, 'Rozšírené informácie', 'obchodny_partner_rozsirene_informacie', 20);
/*30*/ UPDATE `form_element` SET `form_group_id`=1 WHERE  `id`=1;
/*31*/ UPDATE `form_element` SET `form_group_id`=1 WHERE  `id`=2;
/*32*/ UPDATE `form_element` SET `css_class`='select2' WHERE  `id`=2;
/*33*/ UPDATE `form_element` SET `css_class`='select2' WHERE  `id`=1;