chore: refs #7874 refactor table
gitea/salix/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jorge Penadés 2024-09-25 12:19:12 +02:00
parent ddebd31648
commit 3e270befa5
1 changed files with 6 additions and 6 deletions

View File

@ -1,14 +1,14 @@
-- Place your SQL code here
-- vn.clientObservationType
CREATE TABLE IF NOT EXISTS vn.clientObservationType(
id tinyint(3) unsigned NOT NULL AUTO_INCREMENT,
code varchar(45) NOT NULL,
clientFk int(11) NOT NULL,
observationTypeFk tinyint(3) unsigned NOT NULL,
description varchar(50) NOT NULL,
PRIMARY KEY (id)
PRIMARY KEY (id),
CONSTRAINT `clientFgn` FOREIGN KEY (`clientFk`) REFERENCES `client` (`id`) ON DELETE CASCADE ON UPDATE CASCADE,
CONSTRAINT `clientObservationFgn` FOREIGN KEY (`observationTypeFk`) REFERENCES `observationType` (`id`) ON DELETE CASCADE ON UPDATE CASCADE
);
ALTER TABLE vn.clientObservation ADD COLUMN typeFk tinyint(3) unsigned NOT NULL;
ALTER TABLE vn.clientObservation ADD CONSTRAINT clientObservationTypeFk FOREIGN KEY (typeFk) REFERENCES vn.clientObservationType(id);
INSERT INTO salix.ACL
SET model = 'ClientObservationType',
property = '*',