Updated database script.
Database Node support versions and editor id. Updated NODE_DATA_PROVIDER with new features. collaborator_nodes: Possible list of nodes edited by a given user id as collaborator author_nodes: Possible list of nodes of a given users as creator of them. Updated test cases
This commit is contained in:
@@ -25,7 +25,6 @@ CREATE TABLE IF NOT EXISTS `cms_dev`.`users` (
|
|||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
UNIQUE INDEX `username` (`username` ASC))
|
UNIQUE INDEX `username` (`username` ASC))
|
||||||
ENGINE = InnoDB
|
ENGINE = InnoDB
|
||||||
AUTO_INCREMENT = 2
|
|
||||||
DEFAULT CHARACTER SET = latin1;
|
DEFAULT CHARACTER SET = latin1;
|
||||||
|
|
||||||
|
|
||||||
@@ -41,15 +40,22 @@ CREATE TABLE IF NOT EXISTS `cms_dev`.`nodes` (
|
|||||||
`summary` TEXT NOT NULL,
|
`summary` TEXT NOT NULL,
|
||||||
`content` MEDIUMTEXT NOT NULL,
|
`content` MEDIUMTEXT NOT NULL,
|
||||||
`author_id` INT(10) UNSIGNED NULL DEFAULT NULL,
|
`author_id` INT(10) UNSIGNED NULL DEFAULT NULL,
|
||||||
|
`version` INT(10) ZEROFILL NULL,
|
||||||
|
`editor_id` INT(10) UNSIGNED NULL DEFAULT NULL,
|
||||||
PRIMARY KEY (`id`),
|
PRIMARY KEY (`id`),
|
||||||
INDEX `fk_nodes_users1_idx` (`author_id` ASC),
|
INDEX `fk_nodes_users1_idx` (`author_id` ASC),
|
||||||
|
INDEX `fk_nodes_users2_idx` (`editor_id` ASC),
|
||||||
CONSTRAINT `fk_nodes_users1`
|
CONSTRAINT `fk_nodes_users1`
|
||||||
FOREIGN KEY (`author_id`)
|
FOREIGN KEY (`author_id`)
|
||||||
REFERENCES `cms_dev`.`users` (`id`)
|
REFERENCES `cms_dev`.`users` (`id`)
|
||||||
ON DELETE NO ACTION
|
ON DELETE NO ACTION
|
||||||
|
ON UPDATE NO ACTION,
|
||||||
|
CONSTRAINT `fk_nodes_users2`
|
||||||
|
FOREIGN KEY (`editor_id`)
|
||||||
|
REFERENCES `cms_dev`.`users` (`id`)
|
||||||
|
ON DELETE NO ACTION
|
||||||
ON UPDATE NO ACTION)
|
ON UPDATE NO ACTION)
|
||||||
ENGINE = InnoDB
|
ENGINE = InnoDB
|
||||||
AUTO_INCREMENT = 2
|
|
||||||
DEFAULT CHARACTER SET = latin1;
|
DEFAULT CHARACTER SET = latin1;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user