Files
BeWoPlaner/Model/Changes_2026-05-12 AiPromptbausteinRoutine Favoriten.txt

27 lines
1.1 KiB
Plaintext

INSERT INTO `.executedscripts`
VALUES ('Changes_2026-05-12 AiPromptbausteinRoutine Favoriten', CURDATE());
ALTER TABLE `aipromptbausteinroutine`
RENAME TO `aipromptbausteinroutine` ;
CREATE TABLE `aipromptbausteinroutine2empfavorite` (
`AiPromptbausteinRoutineOid` bigint NOT NULL,
`EmployeeOid` bigint NOT NULL,
PRIMARY KEY (`AiPromptbausteinRoutineOid`,`EmployeeOid`),
CONSTRAINT `FK_AIPROMPTBAUSTEINROUTINE2EMPFAV_AIPROMPT` FOREIGN KEY (`AiPromptbausteinRoutineOid`) REFERENCES `aipromptbausteinroutine` (`Oid`),
CONSTRAINT `FK_AIPROMPTBAUSTEINROUTINE2EMPFAV_APPUSER` FOREIGN KEY (`EmployeeOid`) REFERENCES `employee` (`Oid`)
) ENGINE=InnoDB DEFAULT CHARSET=latin1;
ALTER TABLE `aipromptbausteinroutinestep`
ADD COLUMN `RoutineOid` BIGINT NULL AFTER `PromptReferenceVersion`,
ADD INDEX `FK_AIPROMPTROUTINESTEP_ROUTINE_idx` (`RoutineOid` ASC) VISIBLE;
;
ALTER TABLE `aipromptbausteinroutinestep`
ADD CONSTRAINT `FK_AIPROMPTROUTINESTEP_ROUTINE`
FOREIGN KEY (`RoutineOid`)
REFERENCES `aipromptbausteinroutine` (`Oid`)
ON DELETE CASCADE
ON UPDATE CASCADE;
ALTER TABLE `aipromptbausteinroutine`
DROP COLUMN `IsFavorite`;