fixes the installation and uninstallation SQL scripts
This commit is contained in:
parent
e7e50acb3d
commit
a7de4e1fec
5 changed files with 381 additions and 233 deletions
76
web/Models/StaticPage.master
Normal file
76
web/Models/StaticPage.master
Normal file
|
|
@ -0,0 +1,76 @@
|
|||
<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %>
|
||||
<!DOCTYPE html>
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
|
||||
<asp:ContentPlaceHolder id="init" runat="server">
|
||||
</asp:ContentPlaceHolder>
|
||||
<% ViewState["orgtitle"] = T.GetString(Page.Title); %>
|
||||
<% Page.Title = ViewState["orgtitle"] + " - " + YavscHelpers.SiteName; %>
|
||||
<head runat="server">
|
||||
<meta name="viewport" content="width=device-width" />
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
|
||||
<link rel="stylesheet" href="/Theme/style.css"/>
|
||||
<link rel="icon" type="image/png" href="/favicon.png" />
|
||||
<asp:ContentPlaceHolder id="head" runat="server">
|
||||
</asp:ContentPlaceHolder>
|
||||
<link href='http://fonts.googleapis.com/css?family=Dancing+Script:400,700' rel='stylesheet' type='text/css'/>
|
||||
</head>
|
||||
<body>
|
||||
<header>
|
||||
<asp:ContentPlaceHolder ID="overHeaderOne" runat="server">
|
||||
<h1><a href="<%= Html.Encode(Request.Url.AbsoluteUri.ToString()) %>"> <%=ViewState["orgtitle"]%> </a> -
|
||||
<a href="<%=Request.Url.Scheme + "://" + Request.Url.Authority%>"><%= YavscHelpers.SiteName %></a>
|
||||
</h1>
|
||||
</asp:ContentPlaceHolder>
|
||||
<asp:ContentPlaceHolder ID="header" runat="server"></asp:ContentPlaceHolder>
|
||||
<% if (ViewData["Error"]!=null) { %>
|
||||
<div class="error">
|
||||
<%= Html.Encode(ViewData["Error"]) %>
|
||||
</div>
|
||||
<% } %>
|
||||
<% if (ViewData["Message"]!=null) { %>
|
||||
<div class="message">
|
||||
<%= Html.Encode(ViewData["Message"]) %>
|
||||
</div>
|
||||
<% } %>
|
||||
|
||||
</header>
|
||||
<main>
|
||||
|
||||
<asp:ContentPlaceHolder ID="MainContent" runat="server">
|
||||
</asp:ContentPlaceHolder>
|
||||
|
||||
|
||||
</main>
|
||||
<aside>
|
||||
<asp:ContentPlaceHolder ID="MASContent" runat="server">
|
||||
</asp:ContentPlaceHolder>
|
||||
<div id="login">
|
||||
<% if (Membership.GetUser()==null) { %>
|
||||
<%= Html.ActionLink( YavscHelpers.SiteName, "Index", "Home" ,null, new { @class="actionlink" } ) %>
|
||||
<span class="hidcom"> Page d'accueil </span>
|
||||
<%= Html.ActionLink("Login", "Login", "Account", new { returnUrl=Request.Url.PathAndQuery }, new { @class="actionlink" } ) %>
|
||||
<span class="hidcom">Pour pouvoir poster ou commenter</span>
|
||||
<a href="<%=Request.Url.Scheme + "://" + Request.Url.Authority + "/Google/Login"%>?returnUrl=<%=Request.Url.PathAndQuery%>" class="actionlink">
|
||||
<img src="/images/sign-in-with-google-s.png" style="max-height:1.5em; max-width:6em;" alt="Google sign in">
|
||||
</a>
|
||||
<span class="hidcom">S'authentifier avec son compte Google+</span>
|
||||
<% } else { %>
|
||||
<%= Html.ActionLink(HttpContext.Current.User.Identity.Name, "Profile", "Account", null, new { @class="actionlink" }) %>
|
||||
<span class="hidcom"> Édition de votre profile </span>
|
||||
@ <%= Html.ActionLink( YavscHelpers.SiteName, "Index", "Home" ,null, new { @class="actionlink" }) %>
|
||||
<span class="hidcom"> Page d'accueil </span>
|
||||
<a href="/Blogs/Post" class="actionlink">Poster</a>
|
||||
<span class="hidcom"> Édition d'un nouveau billet </span>
|
||||
<%= Html.ActionLink( "Deconnexion", "Logout", "Account", new { returnUrl=Request.Url.PathAndQuery }, new { @class="actionlink" }) %>
|
||||
<% } %>
|
||||
</div>
|
||||
</aside>
|
||||
<footer>
|
||||
<% foreach ( string link in Yavsc.ThanksHelper.Links()) { %>
|
||||
<%= link %>
|
||||
<% } %>
|
||||
</footer>
|
||||
</body>
|
||||
</html>
|
||||
|
||||
8
web/Views/Admin/Created.aspx
Normal file
8
web/Views/Admin/Created.aspx
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<%@ Page Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<TaskOutput>" %>
|
||||
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
|
||||
<h1><%=Html.Encode(ViewData["BackupName"])%> Restauration</h1>
|
||||
<div><h2>Error message </h2> <%= Html.Encode(Model.Error) %></div>
|
||||
<div><h2>Message </h2> <%= Html.Encode(Model.Message) %></div>
|
||||
<div><h2>Exit Code</h2> <%= Html.Encode(Model.ExitCode) %></div>
|
||||
|
||||
</asp:Content>
|
||||
37
web/Views/Admin/InitDb.aspx
Normal file
37
web/Views/Admin/InitDb.aspx
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
<%@ Page Title="Restore" Language="C#" MasterPageFile="~/Models/App.master" Inherits="System.Web.Mvc.ViewPage<DataAccess>" %>
|
||||
<asp:Content ID="MainContentContent" ContentPlaceHolderID="MainContent" runat="server">
|
||||
<%= Html.ValidationSummary("Restore a database backup") %>
|
||||
<% using (Html.BeginForm("Restore","Admin")) { %>
|
||||
|
||||
<% string [] bcfiles = (string[]) ViewData["Backups"]; %>
|
||||
<select name="backupName">
|
||||
<% foreach (string s in bcfiles)
|
||||
{
|
||||
%>
|
||||
<option value="<%=s%>"><%=s%></option>
|
||||
<%
|
||||
}
|
||||
%>
|
||||
</select>
|
||||
<label for="dataOnly">Data only :</label>
|
||||
<%= Html.CheckBox("dataOnly")%>
|
||||
|
||||
<%= Html.LabelFor(model => model.Host) %>:
|
||||
<%= Html.TextBox( "Host" ) %>
|
||||
<%= Html.ValidationMessage("Host", "*") %><br/>
|
||||
<%= Html.LabelFor(model => model.Port) %>:
|
||||
<%= Html.TextBox( "Port" ) %>
|
||||
<%= Html.ValidationMessage("Port", "*") %><br/>
|
||||
<%= Html.LabelFor(model => model.Dbname) %>:
|
||||
<%= Html.TextBox( "Dbname" ) %>
|
||||
<%= Html.ValidationMessage("Dbname", "*") %><br/>
|
||||
<%= Html.LabelFor(model => model.Dbuser) %>:
|
||||
<%= Html.TextBox( "Dbuser" ) %>
|
||||
<%= Html.ValidationMessage("Dbuser", "*") %><br/>
|
||||
<%= Html.LabelFor(model => model.Password) %>:
|
||||
<%= Html.Password( "Password" ) %>
|
||||
<%= Html.ValidationMessage("Password", "*") %><br/>
|
||||
|
||||
<input type="submit"/>
|
||||
<% } %>
|
||||
</asp:Content>
|
||||
470
web/instdbws.sql
470
web/instdbws.sql
|
|
@ -1,20 +1,159 @@
|
|||
|
||||
-- Table: users
|
||||
|
||||
CREATE TABLE blfiles
|
||||
-- DROP TABLE users;
|
||||
|
||||
CREATE TABLE users
|
||||
(
|
||||
_id bigint NOT NULL DEFAULT nextval('bltags__id_seq'::regclass), -- Identifier
|
||||
name character varying(2048), -- File Name, relative to the user home directory, must not begin with a slash.
|
||||
blid bigint, -- Blog entry identifier (foreign key)
|
||||
CONSTRAINT bltags_pkey PRIMARY KEY (_id),
|
||||
CONSTRAINT bltags_blid_fkey FOREIGN KEY (blid)
|
||||
REFERENCES blog (_id) MATCH SIMPLE
|
||||
pkid character varying NOT NULL,
|
||||
username character varying(255) NOT NULL,
|
||||
applicationname character varying(255) NOT NULL,
|
||||
email character varying(128) NOT NULL,
|
||||
comment character varying(255),
|
||||
passw character varying(128) NOT NULL,
|
||||
passwordquestion character varying(255),
|
||||
passwordanswer character varying(255),
|
||||
isapproved boolean,
|
||||
lastactivitydate timestamp with time zone,
|
||||
lastlogindate timestamp with time zone,
|
||||
lastpasswordchangeddate timestamp with time zone,
|
||||
creationdate timestamp with time zone,
|
||||
islockedout boolean,
|
||||
lastlockedoutdate timestamp with time zone,
|
||||
failedpasswordattemptcount integer,
|
||||
failedpasswordattemptwindowstart timestamp with time zone,
|
||||
failedpasswordanswerattemptcount integer,
|
||||
failedpasswordanswerattemptwindowstart timestamp with time zone,
|
||||
CONSTRAINT users_pkey PRIMARY KEY (pkid),
|
||||
CONSTRAINT uniquelogin UNIQUE (applicationname, email),
|
||||
CONSTRAINT uniquemail UNIQUE (applicationname, username)
|
||||
)
|
||||
WITH (
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
-- Table: roles
|
||||
|
||||
-- DROP TABLE roles;
|
||||
|
||||
CREATE TABLE roles
|
||||
(
|
||||
rolename character varying(255) NOT NULL,
|
||||
applicationname character varying(255) NOT NULL,
|
||||
comment character varying(255) NOT NULL,
|
||||
CONSTRAINT roles_pkey PRIMARY KEY (rolename, applicationname)
|
||||
)
|
||||
WITH (
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
COMMENT ON TABLE roles
|
||||
IS 'Web application roles';
|
||||
|
||||
-- Table: usersroles
|
||||
|
||||
-- DROP TABLE usersroles;
|
||||
|
||||
CREATE TABLE usersroles
|
||||
(
|
||||
applicationname character varying(255) NOT NULL,
|
||||
rolename character varying(255) NOT NULL,
|
||||
username character varying(255) NOT NULL,
|
||||
CONSTRAINT attrroles_pkey PRIMARY KEY (applicationname, rolename, username),
|
||||
CONSTRAINT usersroles_fk_role FOREIGN KEY (applicationname, rolename)
|
||||
REFERENCES roles (applicationname, rolename) MATCH SIMPLE
|
||||
ON UPDATE CASCADE ON DELETE CASCADE,
|
||||
CONSTRAINT usersroles_fk_user FOREIGN KEY (applicationname, username)
|
||||
REFERENCES users (applicationname, username) MATCH SIMPLE
|
||||
ON UPDATE CASCADE ON DELETE CASCADE
|
||||
)
|
||||
WITH (
|
||||
OIDS=FALSE
|
||||
);
|
||||
COMMENT ON COLUMN blfiles._id IS 'Identifier';
|
||||
COMMENT ON COLUMN blfiles.name IS 'File Name, relative to the user home directory, must not begin with a slash.';
|
||||
COMMENT ON COLUMN blfiles.blid IS 'Blog entry identifier (foreign key)';
|
||||
|
||||
-- DROP TABLE profiles;
|
||||
|
||||
CREATE TABLE profiles
|
||||
(
|
||||
uniqueid bigserial NOT NULL,
|
||||
username character varying(255) NOT NULL,
|
||||
applicationname character varying(255) NOT NULL,
|
||||
isanonymous boolean,
|
||||
lastactivitydate timestamp with time zone,
|
||||
lastupdateddate timestamp with time zone,
|
||||
CONSTRAINT profiles_pkey PRIMARY KEY (uniqueid),
|
||||
CONSTRAINT fk_profileusers FOREIGN KEY (username, applicationname)
|
||||
REFERENCES users (username, applicationname) MATCH SIMPLE
|
||||
ON UPDATE CASCADE ON DELETE CASCADE,
|
||||
CONSTRAINT pkprofiles UNIQUE (username, applicationname)
|
||||
)
|
||||
WITH (
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
-- Table: profiledata
|
||||
|
||||
-- DROP TABLE profiledata;
|
||||
|
||||
CREATE TABLE profiledata
|
||||
(
|
||||
uniqueid integer,
|
||||
zipcode character varying(10),
|
||||
cityandstate character varying(255),
|
||||
blogtitle character varying(255), -- Blog Title
|
||||
address character varying(2048), -- Postal address
|
||||
country character varying(100),
|
||||
website character varying(256),
|
||||
blogvisible boolean,
|
||||
hasavatar boolean, -- True when user has specified an image for avatar
|
||||
name character varying(1024),
|
||||
phone character varying(15),
|
||||
mobile character varying(15),
|
||||
accountnumber character varying(15), -- Numero de compte
|
||||
bankedkey integer, -- clé RIB
|
||||
bankcode character varying(5), -- Code banque
|
||||
wicketcode character varying(5),
|
||||
iban character varying(33),
|
||||
bic character varying(15),
|
||||
gtoken character varying(512),
|
||||
grefreshtoken character varying(512), -- Google refresh token
|
||||
gtokentype character varying(256), -- Google access token type
|
||||
gcalid character varying(255),
|
||||
gtokenexpir timestamp with time zone, -- Google access token expiration date
|
||||
avatar character varying(512), -- url for an avatar
|
||||
gcalapi boolean NOT NULL DEFAULT false, -- true when user authorized to use its Google calendar
|
||||
CONSTRAINT fkprofiles2 FOREIGN KEY (uniqueid)
|
||||
REFERENCES profiles (uniqueid) MATCH SIMPLE
|
||||
ON UPDATE CASCADE ON DELETE CASCADE
|
||||
)
|
||||
WITH (
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
COMMENT ON COLUMN profiledata.blogtitle IS 'Blog Title';
|
||||
COMMENT ON COLUMN profiledata.address IS 'Postal address';
|
||||
COMMENT ON COLUMN profiledata.hasavatar IS 'True when user has specified an image for avatar';
|
||||
COMMENT ON COLUMN profiledata.accountnumber IS 'Numero de compte';
|
||||
COMMENT ON COLUMN profiledata.bankedkey IS 'clé RIB';
|
||||
COMMENT ON COLUMN profiledata.bankcode IS 'Code banque';
|
||||
COMMENT ON COLUMN profiledata.gtoken IS 'Google authentification token';
|
||||
COMMENT ON COLUMN profiledata.gcalid IS 'Google calendar identifier';
|
||||
COMMENT ON COLUMN profiledata.gtokentype IS 'Google access token type';
|
||||
COMMENT ON COLUMN profiledata.grefreshtoken IS 'Google refresh token';
|
||||
COMMENT ON COLUMN profiledata.gtokenexpir IS 'Google access token expiration date';
|
||||
COMMENT ON COLUMN profiledata.avatar IS 'url for an avatar';
|
||||
|
||||
-- Index: fki_fkprofiles2
|
||||
|
||||
-- DROP INDEX fki_fkprofiles2;
|
||||
|
||||
CREATE INDEX fki_fkprofiles2
|
||||
ON profiledata
|
||||
USING btree
|
||||
(uniqueid);
|
||||
|
||||
-- Table: profiles
|
||||
|
||||
|
||||
-- Table: blog
|
||||
|
||||
|
|
@ -39,6 +178,24 @@ WITH (
|
|||
OIDS=FALSE
|
||||
);
|
||||
|
||||
-- Table: blfiles
|
||||
CREATE TABLE blfiles
|
||||
(
|
||||
_id bigserial NOT NULL, -- Identifier
|
||||
name character varying(2048), -- File Name, relative to the user home directory, must not begin with a slash.
|
||||
blid bigint, -- Blog entry identifier (foreign key)
|
||||
CONSTRAINT bltags_pkey PRIMARY KEY (_id),
|
||||
CONSTRAINT bltags_blid_fkey FOREIGN KEY (blid)
|
||||
REFERENCES blog (_id) MATCH SIMPLE
|
||||
ON UPDATE CASCADE ON DELETE CASCADE
|
||||
)
|
||||
WITH (
|
||||
OIDS=FALSE
|
||||
);
|
||||
COMMENT ON COLUMN blfiles._id IS 'Identifier';
|
||||
COMMENT ON COLUMN blfiles.name IS 'File Name, relative to the user home directory, must not begin with a slash.';
|
||||
COMMENT ON COLUMN blfiles.blid IS 'Blog entry identifier (foreign key)';
|
||||
|
||||
-- Table: commandes
|
||||
|
||||
-- DROP TABLE commandes;
|
||||
|
|
@ -166,29 +323,7 @@ WITH (
|
|||
OIDS=FALSE
|
||||
);
|
||||
|
||||
-- Table: histowritting
|
||||
|
||||
-- DROP TABLE histowritting;
|
||||
|
||||
CREATE TABLE histowritting
|
||||
(
|
||||
datechange timestamp with time zone NOT NULL DEFAULT now(),
|
||||
status integer,
|
||||
wrtid bigint NOT NULL,
|
||||
username character varying(255),
|
||||
applicationname character varying,
|
||||
_id bigserial NOT NULL,
|
||||
CONSTRAINT histowritting_pkey PRIMARY KEY (_id),
|
||||
CONSTRAINT histowritting_username_fkey FOREIGN KEY (username, applicationname)
|
||||
REFERENCES users (username, applicationname) MATCH SIMPLE
|
||||
ON UPDATE NO ACTION ON DELETE NO ACTION,
|
||||
CONSTRAINT histowritting_wrtid_fkey FOREIGN KEY (wrtid)
|
||||
REFERENCES writtings (_id) MATCH SIMPLE
|
||||
ON UPDATE CASCADE ON DELETE CASCADE
|
||||
)
|
||||
WITH (
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
-- Table: hr
|
||||
|
||||
|
|
@ -225,88 +360,6 @@ COMMENT ON COLUMN product."Description" IS 'Product description';
|
|||
|
||||
|
||||
|
||||
-- Table: profiledata
|
||||
|
||||
-- DROP TABLE profiledata;
|
||||
|
||||
CREATE TABLE profiledata
|
||||
(
|
||||
uniqueid integer,
|
||||
zipcode character varying(10),
|
||||
cityandstate character varying(255),
|
||||
blogtitle character varying(255), -- Blog Title
|
||||
address character varying(2048), -- Postal address
|
||||
country character varying(100),
|
||||
website character varying(256),
|
||||
blogvisible boolean,
|
||||
hasavatar boolean, -- True when user has specified an image for avatar
|
||||
name character varying(1024),
|
||||
phone character varying(15),
|
||||
mobile character varying(15),
|
||||
accountnumber character varying(15), -- Numero de compte
|
||||
bankedkey integer, -- clé RIB
|
||||
bankcode character varying(5), -- Code banque
|
||||
wicketcode character varying(5),
|
||||
iban character varying(33),
|
||||
bic character varying(15),
|
||||
gtoken character varying(512),
|
||||
grefreshtoken character varying(512), -- Google refresh token
|
||||
gtokentype character varying(256), -- Google access token type
|
||||
gcalid character varying(255),
|
||||
gtokenexpir timestamp with time zone, -- Google access token expiration date
|
||||
avatar character varying(512), -- url for an avatar
|
||||
gcalapi boolean NOT NULL DEFAULT false, -- true when user authorized to use its Google calendar
|
||||
CONSTRAINT fkprofiles2 FOREIGN KEY (uniqueid)
|
||||
REFERENCES profiles (uniqueid) MATCH SIMPLE
|
||||
ON UPDATE CASCADE ON DELETE CASCADE
|
||||
)
|
||||
WITH (
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
COMMENT ON COLUMN profiledata.blogtitle IS 'Blog Title';
|
||||
COMMENT ON COLUMN profiledata.address IS 'Postal address';
|
||||
COMMENT ON COLUMN profiledata.hasavatar IS 'True when user has specified an image for avatar';
|
||||
COMMENT ON COLUMN profiledata.accountnumber IS 'Numero de compte';
|
||||
COMMENT ON COLUMN profiledata.bankedkey IS 'clé RIB';
|
||||
COMMENT ON COLUMN profiledata.bankcode IS 'Code banque';
|
||||
COMMENT ON COLUMN profiledata.gtoken IS 'Google authentification token';
|
||||
COMMENT ON COLUMN profiledata.gcalid IS 'Google calendar identifier';
|
||||
COMMENT ON COLUMN profiledata.gtokentype IS 'Google access token type';
|
||||
COMMENT ON COLUMN profiledata.grefreshtoken IS 'Google refresh token';
|
||||
COMMENT ON COLUMN profiledata.gtokenexpir IS 'Google access token expiration date';
|
||||
COMMENT ON COLUMN profiledata.avatar IS 'url for an avatar';
|
||||
|
||||
-- Index: fki_fkprofiles2
|
||||
|
||||
-- DROP INDEX fki_fkprofiles2;
|
||||
|
||||
CREATE INDEX fki_fkprofiles2
|
||||
ON profiledata
|
||||
USING btree
|
||||
(uniqueid);
|
||||
|
||||
-- Table: profiles
|
||||
|
||||
-- DROP TABLE profiles;
|
||||
|
||||
CREATE TABLE profiles
|
||||
(
|
||||
uniqueid bigserial NOT NULL,
|
||||
username character varying(255) NOT NULL,
|
||||
applicationname character varying(255) NOT NULL,
|
||||
isanonymous boolean,
|
||||
lastactivitydate timestamp with time zone,
|
||||
lastupdateddate timestamp with time zone,
|
||||
CONSTRAINT profiles_pkey PRIMARY KEY (uniqueid),
|
||||
CONSTRAINT fk_profileusers FOREIGN KEY (username, applicationname)
|
||||
REFERENCES users (username, applicationname) MATCH SIMPLE
|
||||
ON UPDATE CASCADE ON DELETE CASCADE,
|
||||
CONSTRAINT pkprofiles UNIQUE (username, applicationname)
|
||||
)
|
||||
WITH (
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
|
||||
-- Table: projet
|
||||
|
|
@ -338,24 +391,7 @@ CREATE INDEX fki_pk_project_manager
|
|||
USING btree
|
||||
(managerid COLLATE pg_catalog."default", "ApplicationName" COLLATE pg_catalog."default");
|
||||
|
||||
-- Table: roles
|
||||
|
||||
-- DROP TABLE roles;
|
||||
|
||||
CREATE TABLE roles
|
||||
(
|
||||
rolename character varying(255) NOT NULL,
|
||||
applicationname character varying(255) NOT NULL,
|
||||
comment character varying(255) NOT NULL,
|
||||
CONSTRAINT roles_pkey PRIMARY KEY (rolename, applicationname)
|
||||
)
|
||||
WITH (
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
COMMENT ON TABLE roles
|
||||
IS 'Web application roles';
|
||||
|
||||
|
||||
-- Table: stocksymbols
|
||||
|
||||
-- DROP TABLE stocksymbols;
|
||||
|
|
@ -412,6 +448,29 @@ WITH (
|
|||
OIDS=FALSE
|
||||
);
|
||||
|
||||
|
||||
-- Table: tasks
|
||||
|
||||
-- DROP TABLE tasks;
|
||||
|
||||
CREATE TABLE tasks
|
||||
(
|
||||
id bigserial NOT NULL,
|
||||
name character varying NOT NULL,
|
||||
start date NOT NULL,
|
||||
endd date NOT NULL,
|
||||
tdesc text NOT NULL,
|
||||
prid bigint NOT NULL,
|
||||
CONSTRAINT tasks_pk_new PRIMARY KEY (id),
|
||||
CONSTRAINT tasks_fk_new FOREIGN KEY (prid)
|
||||
REFERENCES projet (id) MATCH SIMPLE
|
||||
ON UPDATE NO ACTION ON DELETE NO ACTION
|
||||
)
|
||||
WITH (
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
|
||||
-- Table: taskdeps
|
||||
|
||||
-- DROP TABLE taskdeps;
|
||||
|
|
@ -457,105 +516,6 @@ CREATE INDEX fki_pk_foreign_task
|
|||
|
||||
|
||||
|
||||
-- Table: tasks
|
||||
|
||||
-- DROP TABLE tasks;
|
||||
|
||||
CREATE TABLE tasks
|
||||
(
|
||||
id bigserial NOT NULL,
|
||||
name character varying NOT NULL,
|
||||
start date NOT NULL,
|
||||
endd date NOT NULL,
|
||||
tdesc text NOT NULL,
|
||||
prid bigint NOT NULL,
|
||||
CONSTRAINT tasks_pk_new PRIMARY KEY (id),
|
||||
CONSTRAINT tasks_fk_new FOREIGN KEY (prid)
|
||||
REFERENCES projet (id) MATCH SIMPLE
|
||||
ON UPDATE NO ACTION ON DELETE NO ACTION
|
||||
)
|
||||
WITH (
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
-- Table: users
|
||||
|
||||
-- DROP TABLE users;
|
||||
|
||||
CREATE TABLE users
|
||||
(
|
||||
pkid character varying NOT NULL,
|
||||
username character varying(255) NOT NULL,
|
||||
applicationname character varying(255) NOT NULL,
|
||||
email character varying(128) NOT NULL,
|
||||
comment character varying(255),
|
||||
passw character varying(128) NOT NULL,
|
||||
passwordquestion character varying(255),
|
||||
passwordanswer character varying(255),
|
||||
isapproved boolean,
|
||||
lastactivitydate timestamp with time zone,
|
||||
lastlogindate timestamp with time zone,
|
||||
lastpasswordchangeddate timestamp with time zone,
|
||||
creationdate timestamp with time zone,
|
||||
islockedout boolean,
|
||||
lastlockedoutdate timestamp with time zone,
|
||||
failedpasswordattemptcount integer,
|
||||
failedpasswordattemptwindowstart timestamp with time zone,
|
||||
failedpasswordanswerattemptcount integer,
|
||||
failedpasswordanswerattemptwindowstart timestamp with time zone,
|
||||
CONSTRAINT users_pkey PRIMARY KEY (pkid),
|
||||
CONSTRAINT uniquelogin UNIQUE (applicationname, email),
|
||||
CONSTRAINT uniquemail UNIQUE (applicationname, username)
|
||||
)
|
||||
WITH (
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
-- Table: usersroles
|
||||
|
||||
-- DROP TABLE usersroles;
|
||||
|
||||
CREATE TABLE usersroles
|
||||
(
|
||||
applicationname character varying(255) NOT NULL,
|
||||
rolename character varying(255) NOT NULL,
|
||||
username character varying(255) NOT NULL,
|
||||
CONSTRAINT attrroles_pkey PRIMARY KEY (applicationname, rolename, username),
|
||||
CONSTRAINT usersroles_fk_role FOREIGN KEY (applicationname, rolename)
|
||||
REFERENCES roles (applicationname, rolename) MATCH SIMPLE
|
||||
ON UPDATE CASCADE ON DELETE CASCADE,
|
||||
CONSTRAINT usersroles_fk_user FOREIGN KEY (applicationname, username)
|
||||
REFERENCES users (applicationname, username) MATCH SIMPLE
|
||||
ON UPDATE CASCADE ON DELETE CASCADE
|
||||
)
|
||||
WITH (
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
-- Table: wrfiles
|
||||
|
||||
-- DROP TABLE wrfiles;
|
||||
|
||||
CREATE TABLE wrfiles
|
||||
(
|
||||
_id bigint NOT NULL DEFAULT nextval('wrtags__id_seq'::regclass), -- Identifier
|
||||
name character varying(2048), -- File Name, relative to the user home directory, must not begin with a slash.
|
||||
wrid bigint, -- Writting identifier (foreign key)
|
||||
CONSTRAINT wrtags_pkey PRIMARY KEY (_id),
|
||||
CONSTRAINT wrtags_wrid_fkey FOREIGN KEY (wrid)
|
||||
REFERENCES writtings (_id) MATCH SIMPLE
|
||||
ON UPDATE CASCADE ON DELETE CASCADE
|
||||
)
|
||||
WITH (
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
COMMENT ON COLUMN wrfiles._id IS 'Identifier';
|
||||
COMMENT ON COLUMN wrfiles.name IS 'File Name, relative to the user home directory, must not begin with a slash.';
|
||||
COMMENT ON COLUMN wrfiles.wrid IS 'Writting identifier (foreign key)';
|
||||
|
||||
|
||||
|
||||
-- Table: writtings
|
||||
|
||||
-- DROP TABLE writtings;
|
||||
|
|
@ -585,6 +545,8 @@ COMMENT ON COLUMN writtings.productid IS 'Product reference ... may be a key in
|
|||
COMMENT ON COLUMN writtings.ucost IS 'en euro.?';
|
||||
|
||||
|
||||
|
||||
|
||||
-- Table: wrtags
|
||||
|
||||
-- DROP TABLE wrtags;
|
||||
|
|
@ -615,3 +577,49 @@ CREATE INDEX fki_cstwrtagsref
|
|||
(tagid);
|
||||
|
||||
|
||||
-- Table: wrfiles
|
||||
|
||||
-- DROP TABLE wrfiles;
|
||||
|
||||
CREATE TABLE wrfiles
|
||||
(
|
||||
_id bigserial NOT NULL , -- Identifier
|
||||
name character varying(2048), -- File Name, relative to the user home directory, must not begin with a slash.
|
||||
wrid bigint, -- Writting identifier (foreign key)
|
||||
CONSTRAINT wrtags_pkey PRIMARY KEY (_id),
|
||||
CONSTRAINT wrtags_wrid_fkey FOREIGN KEY (wrid)
|
||||
REFERENCES writtings (_id) MATCH SIMPLE
|
||||
ON UPDATE CASCADE ON DELETE CASCADE
|
||||
)
|
||||
WITH (
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
||||
COMMENT ON COLUMN wrfiles._id IS 'Identifier';
|
||||
COMMENT ON COLUMN wrfiles.name IS 'File Name, relative to the user home directory, must not begin with a slash.';
|
||||
COMMENT ON COLUMN wrfiles.wrid IS 'Writting identifier (foreign key)';
|
||||
|
||||
|
||||
-- Table: histowritting
|
||||
|
||||
-- DROP TABLE histowritting;
|
||||
|
||||
CREATE TABLE histowritting
|
||||
(
|
||||
datechange timestamp with time zone NOT NULL DEFAULT now(),
|
||||
status integer,
|
||||
wrtid bigint NOT NULL,
|
||||
username character varying(255),
|
||||
applicationname character varying,
|
||||
_id bigserial NOT NULL,
|
||||
CONSTRAINT histowritting_pkey PRIMARY KEY (_id),
|
||||
CONSTRAINT histowritting_username_fkey FOREIGN KEY (username, applicationname)
|
||||
REFERENCES users (username, applicationname) MATCH SIMPLE
|
||||
ON UPDATE NO ACTION ON DELETE NO ACTION,
|
||||
CONSTRAINT histowritting_wrtid_fkey FOREIGN KEY (wrtid)
|
||||
REFERENCES writtings (_id) MATCH SIMPLE
|
||||
ON UPDATE CASCADE ON DELETE CASCADE
|
||||
)
|
||||
WITH (
|
||||
OIDS=FALSE
|
||||
);
|
||||
|
|
@ -1,5 +1,24 @@
|
|||
|
||||
|
||||
DROP TABLE commandes;
|
||||
DROP TABLE hr;
|
||||
DROP TABLE blfiles;
|
||||
DROP table usersroles CASCADE;
|
||||
drop table roles CASCADE;
|
||||
Drop table users CASCADE;
|
||||
|
||||
DROP TABLE profiles CASCADE;
|
||||
DROP TABLE product CASCADE;
|
||||
DROP TABLE stocksymbols CASCADE;
|
||||
DROP TABLE tag CASCADE;
|
||||
DROP TABLE blog CASCADE;
|
||||
DROP TABLE writtings CASCADE;
|
||||
DROP TABLE tasks CASCADE;
|
||||
DROP TABLE estimate CASCADE;
|
||||
DROP TABLE histoestim CASCADE;
|
||||
DROP TABLE histowritting CASCADE;
|
||||
DROP TABLE projet CASCADE;
|
||||
DROP TABLE tagged CASCADE;
|
||||
DROP TABLE profiledata CASCADE;
|
||||
DROP TABLE wrtags CASCADE;
|
||||
DROP TABLE taskdeps CASCADE;
|
||||
DROP TABLE wrfiles CASCADE;
|
||||
DROP TABLE comment CASCADE;
|
||||
Loading…
Add table
Add a link
Reference in a new issue