Move libraries layout', model', `peristence' under cms folder
Updated code to the new layout. Added missing comments. Remove /example/api
This commit is contained in:
1
cms/persistence/implementation/sqlite/scripts/Readme.txt
Normal file
1
cms/persistence/implementation/sqlite/scripts/Readme.txt
Normal file
@@ -0,0 +1 @@
|
||||
Added Stored Procedures
|
||||
@@ -0,0 +1,61 @@
|
||||
-- Creator: MySQL Workbench 6.1.7/ExportSQLite plugin 2009.12.02
|
||||
-- Author: javier
|
||||
-- Caption: New Model
|
||||
-- Project: Name of the project
|
||||
-- Changed: 2014-09-16 23:12
|
||||
-- Created: 2014-09-16 23:12
|
||||
PRAGMA foreign_keys = OFF;
|
||||
|
||||
-- Schema: cms_dev
|
||||
BEGIN;
|
||||
CREATE TABLE "nodes"(
|
||||
"id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL CHECK("id">=0),
|
||||
"publication_date" DATE NOT NULL,
|
||||
"creation_date" DATE NOT NULL,
|
||||
"modification_date" DATE NOT NULL,
|
||||
"title" VARCHAR(255) NOT NULL,
|
||||
"summary" TEXT NOT NULL,
|
||||
"content" MEDIUMTEXT NOT NULL
|
||||
);
|
||||
CREATE TABLE "roles"(
|
||||
"id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL CHECK("id">=0),
|
||||
"role" VARCHAR(100) NOT NULL,
|
||||
CONSTRAINT "role"
|
||||
UNIQUE("role")
|
||||
);
|
||||
CREATE TABLE "users"(
|
||||
"id" INTEGER PRIMARY KEY AUTOINCREMENT NOT NULL CHECK("id">=0),
|
||||
"username" VARCHAR(100) NOT NULL,
|
||||
"password" VARCHAR(100) NOT NULL,
|
||||
"salt" VARCHAR(100) NOT NULL,
|
||||
"email" VARCHAR(250) NOT NULL,
|
||||
CONSTRAINT "username"
|
||||
UNIQUE("username")
|
||||
);
|
||||
CREATE TABLE "users_nodes"(
|
||||
"users_id" INTEGER NOT NULL CHECK("users_id">=0),
|
||||
"nodes_id" INTEGER NOT NULL CHECK("nodes_id">=0),
|
||||
PRIMARY KEY("users_id","nodes_id"),
|
||||
CONSTRAINT "fk_users_has_nodes_nodes1"
|
||||
FOREIGN KEY("nodes_id")
|
||||
REFERENCES "nodes"("id"),
|
||||
CONSTRAINT "fk_users_has_nodes_users"
|
||||
FOREIGN KEY("users_id")
|
||||
REFERENCES "users"("id")
|
||||
);
|
||||
CREATE INDEX "users_nodes.fk_users_has_nodes_nodes1_idx" ON "users_nodes"("nodes_id");
|
||||
CREATE INDEX "users_nodes.fk_users_has_nodes_users_idx" ON "users_nodes"("users_id");
|
||||
CREATE TABLE "users_roles"(
|
||||
"users_id" INTEGER NOT NULL CHECK("users_id">=0),
|
||||
"roles_id" INTEGER NOT NULL CHECK("roles_id">=0),
|
||||
PRIMARY KEY("users_id","roles_id"),
|
||||
CONSTRAINT "fk_users_has_roles_roles1"
|
||||
FOREIGN KEY("roles_id")
|
||||
REFERENCES "roles"("id"),
|
||||
CONSTRAINT "fk_users_has_roles_users1"
|
||||
FOREIGN KEY("users_id")
|
||||
REFERENCES "users"("id")
|
||||
);
|
||||
CREATE INDEX "users_roles.fk_users_has_roles_roles1_idx" ON "users_roles"("roles_id");
|
||||
CREATE INDEX "users_roles.fk_users_has_roles_users1_idx" ON "users_roles"("users_id");
|
||||
COMMIT;
|
||||
14
cms/persistence/implementation/sqlite/scripts/tables.sql
Normal file
14
cms/persistence/implementation/sqlite/scripts/tables.sql
Normal file
@@ -0,0 +1,14 @@
|
||||
DROP TABLE IF EXISTS nodes;
|
||||
|
||||
CREATE TABLE nodes
|
||||
(
|
||||
id smallint unsigned NOT NULL auto_increment,
|
||||
publication_date date NOT NULL, #When the article was published
|
||||
creation_date date NOT NULL, #When the article was created
|
||||
modification_date date NOT NULL, #When the article was updated
|
||||
title varchar(255) NOT NULL, #Full title of the article
|
||||
summary text NOT NULL, #A short summary of the articule
|
||||
content mediumtext NOT NULL, #The HTML content of the article
|
||||
|
||||
PRIMARY KEY (ID)
|
||||
);
|
||||
Reference in New Issue
Block a user