From f618da219d17f69a41e4ebfa1850cbf450d69f11 Mon Sep 17 00:00:00 2001 From: Aytac Ozkan Date: Thu, 3 Sep 2020 03:48:39 +0200 Subject: [PATCH] ***pasword.data.sql --- data.sql | 19 ++++++++++++++++++- 1 file changed, 18 insertions(+), 1 deletion(-) diff --git a/data.sql b/data.sql index 349d61b..00f1bbe 100644 --- a/data.sql +++ b/data.sql @@ -8,7 +8,7 @@ CREATE TABLE IF NOT EXISTS users ( name varchar(50) , surname varchar(50), email varchar(50) UNIQUE NOT NULL, - password varchar(50) NOT NULL, + password varchar(150) NOT NULL, createdAt timestamp NOT NULL DEFAULT NOW(), updatedAt timestamp ); @@ -98,6 +98,23 @@ CREATE TABLE IF NOT EXISTS policy_fields( updatedAt timestamp ); +CREATE TABLE IF NOT EXISTS policy_sources( + id serial PRIMARY KEY, + policy_id integer, + source_id integer, + + CONSTRAINT policy_field_policy_id_fkey FOREIGN KEY (policy_id) + REFERENCES policies(id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE CASCADE, + + CONSTRAINT policy_source_source_id_fkkey FOREIGN KEY (source_id) + REFERENCES sources(id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE CASCADE, + + createdAt timestamp NOT NULL DEFAULT NOW(), + updatedAt timestamp +); + CREATE TABLE IF NOT EXISTS groups ( id serial PRIMARY KEY,