dreamjob/update.sql

69 lines
2.2 KiB
SQL

--
-- Datenbank: `muellersql3`
--
-- --------------------------------------------------------
--
-- Tabellenstruktur für Tabelle `mic_dj_job_opening_worker`
--
CREATE TABLE IF NOT EXISTS `mic_dj_jobs_opening_worker` (
`id` int(11) NOT NULL AUTO_INCREMENT,
`opening_id` int(11) NOT NULL,
`worker_id` int(11) NOT NULL,
PRIMARY KEY (`id`),
UNIQUE KEY `opening_id` (`opening_id`,`worker_id`),
KEY `mic_dj_jobs_opening_worker_favOpening` (`opening_id`),
KEY `mic_dj_jobs_opening_worker_favWorker` (`worker_id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8 AUTO_INCREMENT=1 ;
--
-- Tabellenstruktur für Tabelle `mic_dj_account_cmpy` ändern
-- ProCompanyAccount
--
ALTER TABLE `mic_dj_account_cmpy` ADD `pro_user` INT NOT NULL ;
--
-- Constraints der exportierten Tabellen
--
--
-- Constraints der Tabelle `mic_dj_job_opening_worker`
--
ALTER TABLE `mic_dj_jobs_opening_worker`
ADD CONSTRAINT `mic_dj_jobs_opening_worker_favOpening` FOREIGN KEY (`opening_id`) REFERENCES `mic_dj_jobs_opening` (`id`),
ADD CONSTRAINT `mic_dj_jobs_opening_worker_favWorker` FOREIGN KEY (`worker_id`) REFERENCES `mic_dj_account_wrk` (`djaccount_ptr_id`);
-- ACHTUNG:
-- 3/15
update `mic_dj_account_cmpy` left join `mic_dj_list_branch` on `name`=`branch` set `branch`=`mic_dj_list_branch`.`id`;
ALTER TABLE `mic_dj_account_cmpy` CHANGE `branch` `branch_id` INT(11) NOT NULL;
-- 2/4
update `mic_dj_jobs_opening` left join `mic_dj_list_branch` on `name`=`branch` set `branch`=`mic_dj_list_branch`.`id`;
ALTER TABLE `mic_dj_jobs_opening` CHANGE `branch` `branch_id` INT(11) NOT NULL;
-- LOLA
-- 15/70
update `mic_dj_account_isearch` left join `mic_dj_list_job` on `name`=`job` set `job`=`mic_dj_list_job`.`id`
update `mic_dj_account_isearch` left join `mic_dj_list_branch` on `name`=`branch` set `job`=`mic_dj_list_branch`.`id`
ALTER TABLE `mic_dj_account_isearch` CHANGE `branch` `branch_id` INT(11) NOT NULL;
ALTER TABLE `mic_dj_account_isearch` CHANGE `job` `job_id` INT(11) NOT NULL;
ALTER TABLE `mic_dj_account_isearch`
ADD CONSTRAINT `mic_dj_account_isearch_branch` FOREIGN KEY (`branch_id`) REFERENCES `mic_dj_list_branch` (`id`),
ADD CONSTRAINT `mic_dj_account_isearch_job` FOREIGN KEY (`job_id`) REFERENCES `mic_dj_list_job` (`id`);