Skip to content

Commit

Permalink
**
Browse files Browse the repository at this point in the history
  • Loading branch information
anatolicvs committed Aug 11, 2020
1 parent 11e3531 commit 6fd49b0
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions data.sql
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,13 @@ CREATE TABLE IF NOT EXISTS sources_indices(
CREATE TABLE IF NOT EXISTS policies (
id serial PRIMARY KEY,
name varchar(50) NOT NULL,
source_id integer,
is_default boolean default false,

CONSTRAINT policy_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
);
Expand All @@ -73,7 +78,6 @@ CREATE TABLE IF NOT EXISTS policy_fields(
id serial PRIMARY KEY,
policy_id integer,
std_field_id integer,
source_id integer,

CONSTRAINT policy_field_policy_id_fkey FOREIGN KEY (policy_id)
REFERENCES policies(id) MATCH SIMPLE
Expand All @@ -83,10 +87,6 @@ CREATE TABLE IF NOT EXISTS policy_fields(
REFERENCES std_fields(id) MATCH SIMPLE
ON UPDATE NO ACTION ON DELETE NO ACTION,

CONSTRAINT policy_field_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
);
Expand Down

0 comments on commit 6fd49b0

Please sign in to comment.