This commit is contained in:
parent
ddebd31648
commit
3e270befa5
|
@ -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 = '*',
|
||||
|
|
Loading…
Reference in New Issue