Files
globelus.pl/update/sql.txt
2024-11-11 15:28:20 +01:00

15 lines
1.9 KiB
Plaintext

CREATE TABLE globelus_proposed_candidates ( id INT NOT NULL AUTO_INCREMENT, advert_id INT NOT NULL DEFAULT '0', candidate_id INT NOT NULL DEFAULT '0', PRIMARY KEY (id), INDEX advert_id (advert_id), INDEX candidate_id (candidate_id) )COLLATE='utf8mb4_unicode_ci';
ALTER TABLE globelus_proposed_candidates COLLATE='utf8_polish_ci';
ALTER TABLE `globelus_proposed_candidates` ADD CONSTRAINT `FK_globelus_proposed_candidates_globelus_adverts` FOREIGN KEY (`advert_id`) REFERENCES `globelus_adverts` (`id`) ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE `globelus_proposed_candidates` ADD CONSTRAINT `FK_globelus_proposed_candidates_globelus_users` FOREIGN KEY (`candidate_id`) REFERENCES `globelus_users` (`id`) ON UPDATE CASCADE ON DELETE CASCADE;
ALTER TABLE `globelus_adverts` ADD COLUMN `proposed_candidates_date` DATETIME NULL DEFAULT NULL AFTER `advert_add_img_bottom`;
ALTER TABLE `globelus_proposed_candidates` ADD COLUMN `date_add` DATETIME NOT NULL DEFAULT CURTIME() AFTER `candidate_id`;
CREATE TABLE `globelus_positions` ( `id` INT NOT NULL AUTO_INCREMENT, `name` VARCHAR(255) NULL DEFAULT NULL, PRIMARY KEY (`id`) ) COLLATE='utf8_polish_ci';
ALTER TABLE `globelus_adverts` ADD COLUMN `id_position` INT(11) NULL DEFAULT NULL AFTER `id_voivodeship`;
ALTER TABLE `globelus_adverts` ADD CONSTRAINT `FK_globelus_adverts_globelus_positions` FOREIGN KEY (`id_position`) REFERENCES `globelus_positions` (`id`) ON UPDATE SET NULL ON DELETE SET NULL;
ALTER TABLE `globelus_candidates_positions` CHANGE COLUMN `position` `position` VARCHAR(255) NOT NULL COLLATE 'utf8_polish_ci' AFTER `user_id`, ADD COLUMN `id_position` INT NULL DEFAULT NULL AFTER `position`, ADD INDEX `id_position` (`id_position`);
ALTER TABLE `globelus_candidates_positions` ADD CONSTRAINT `FK_globelus_candidates_positions_globelus_positions` FOREIGN KEY (`id_position`) REFERENCES `globelus_positions` (`id`) ON UPDATE SET NULL ON DELETE SET NULL;
// zaimportować stanowiska
// odkomentować cron-glubelus.php