+ 1

Does anyone know what should i change here its problem with adding forgin key

-- MySQL Workbench Synchronization -- Generated: 2019-08-08 01:41 -- Model: New Model -- Version: 1.0 -- Project: Name of the project -- Author: Nikola SET @OLD_UNIQUE_CHECKS=@@UNIQUE_CHECKS, UNIQUE_CHECKS=0; SET @OLD_FOREIGN_KEY_CHECKS=@@FOREIGN_KEY_CHECKS, FOREIGN_KEY_CHECKS=0; SET @OLD_SQL_MODE=@@SQL_MODE, SQL_MODE='ONLY_FULL_GROUP_BY,STRICT_TRANS_TABLES,NO_ZERO_IN_DATE,NO_ZERO_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_ENGINE_SUBSTITUTION'; ALTER TABLE `brate krecemo znaci`.`Ucesce` CHANGE COLUMN `Funkcija` `Funkcija` TEXT(15) NULL DEFAULT NULL ; ALTER TABLE `brate krecemo znaci`.`zaposleni` ADD CONSTRAINT `fk_zaposleni_Zaposleni_id` FOREIGN KEY (`Zaposleni_id`) REFERENCES `brate krecemo znaci`.`ucesce` (`Zaposleni_id`) ON DELETE RESTRICT ON UPDATE CASCADE; SET SQL_MODE=@OLD_SQL_MODE; SET FOREIGN_KEY_CHECKS=@OLD_FOREIGN_KEY_CHECKS; SET UNIQUE_CHECKS=@OLD_UNIQUE_CHECKS;

7th Aug 2019, 11:57 PM
Dzondzula
Dzondzula - avatar
1 ответ
+ 2
Hello Dzondzula, If possible, add more information describing the problem, 'problem with adding foreign key' is rather a broad subject, we need to narrow down the scope, in a hope that with the problem being isolated - we can expect quality (and to the point) responses. Good luck! 👍
8th Aug 2019, 2:29 AM
Ipang