From 878daa656c9e79c598f0fe459f1cca598141a1ba Mon Sep 17 00:00:00 2001 From: jvelilla Date: Fri, 19 Sep 2014 14:48:20 -0300 Subject: [PATCH] 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 --- .../implementation/mysql/scripts/create_database.sql | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/persistence/implementation/mysql/scripts/create_database.sql b/persistence/implementation/mysql/scripts/create_database.sql index 347934b..7569e9d 100644 --- a/persistence/implementation/mysql/scripts/create_database.sql +++ b/persistence/implementation/mysql/scripts/create_database.sql @@ -25,7 +25,6 @@ CREATE TABLE IF NOT EXISTS `cms_dev`.`users` ( PRIMARY KEY (`id`), UNIQUE INDEX `username` (`username` ASC)) ENGINE = InnoDB -AUTO_INCREMENT = 2 DEFAULT CHARACTER SET = latin1; @@ -41,15 +40,22 @@ CREATE TABLE IF NOT EXISTS `cms_dev`.`nodes` ( `summary` TEXT NOT NULL, `content` MEDIUMTEXT NOT 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`), INDEX `fk_nodes_users1_idx` (`author_id` ASC), + INDEX `fk_nodes_users2_idx` (`editor_id` ASC), CONSTRAINT `fk_nodes_users1` FOREIGN KEY (`author_id`) REFERENCES `cms_dev`.`users` (`id`) 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) ENGINE = InnoDB -AUTO_INCREMENT = 2 DEFAULT CHARACTER SET = latin1;