Skip to content

Commit

Permalink
Merge branch 'master' of forgemia.inra.fr:in-sylva-development/in-syl…
Browse files Browse the repository at this point in the history
…va.infrastructure
  • Loading branch information
Ozcan Aytac; Insylva project committed Jul 7, 2020
2 parents f9a7f34 + 4d1a53e commit 5a34d72
Show file tree
Hide file tree
Showing 2 changed files with 63 additions and 0 deletions.
63 changes: 63 additions & 0 deletions data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,68 @@ CREATE TABLE IF NOT EXISTS sources_indices(
updatedAt timestamp
);

CREATE TABLE IF NOT EXISTS policies (
id serial PRIMARY KEY,
name varchar(50) NOT NULL,
is_default boolean default false,

createdAt timestamp NOT NULL DEFAULT NOW(),
updatedAt timestamp
);


CREATE TABLE IF NOT EXISTS policy_field(
id serial PRIMARY KEY,
policy_id integer,
std_field_id integer,

CONSTRAINT policy_field_policy_id_fkey FOREIGN KEY (policy_id)
REFERENCES policies(id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,

CONSTRAINT std_fields_id_fkkey FOREIGN KEY (std_field_id)
REFERENCES std_fields(id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,

createdAt timestamp NOT NULL DEFAULT NOW(),
updatedAt timestamp
);

CREATE TABLE IF NOT EXISTS policy_user(
id serial PRIMARY KEY,
policy_id integer,
user_id integer,

CONSTRAINT policy_user_user_id_fkey FOREIGN KEY (user_id)
REFERENCES users(id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,

CONSTRAINT policy_user_policy_id_fkey FOREIGN KEY (policy_id)
REFERENCES policies(id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,

createdAt timestamp NOT NULL DEFAULT NOW(),
updatedAt timestamp
);

CREATE TABLE IF NOT EXISTS source_sharing(
id serial PRIMARY KEY,
source_id integer,
user_id integer,

CONSTRAINT source_sharing_user_id_fkey FOREIGN KEY (user_id)
REFERENCES users(id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,

CONSTRAINT source_sharing_source_id_fkey FOREIGN KEY (source_id)
REFERENCES sources(id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,

createdAt timestamp NOT NULL DEFAULT NOW(),
updatedAt timestamp
);


CREATE table IF NOT EXISTS provider_sources (
id serial PRIMARY KEY,
user_id integer NOT NULL,
Expand Down Expand Up @@ -224,6 +286,7 @@ CREATE table IF NOT EXISTS user_search_his(

query text,
name varchar(50),
ui_structure text,
description text,
createdAt timestamp NOT NULL DEFAULT NOW(),
updatedAt timestamp
Expand Down
Binary file modified db_schema.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 5a34d72

Please sign in to comment.