diff --git a/build.sh b/build.sh index 2dd8407..93b7b8f 100755 --- a/build.sh +++ b/build.sh @@ -119,8 +119,8 @@ if [ "$MODE" == "prod" ]; then sed -i -e "s,IP_ADDRESS,${LOGINSERVER}," ipconfig.txt sed -i -e "s,DOMAIN$,${DOMAIN}," ipconfig.txt else - sed -i -e "s/IP_ADDRESS$/0.0.0.0/" ipconfig.txt - sed -i -e "s/DOMAIN$/0.0.0.0/" ipconfig.txt + sed -i -e "s/IP_ADDRESS/0.0.0.0/" ipconfig.txt + sed -i -e "s/DOMAIN/0.0.0.0/" ipconfig.txt fi export IN_SYLVA_KEYCLOAK_HOST=$(grep IN_SYLVA_KEYCLOAK_HOST ipconfig.txt| awk '{print $2}') diff --git a/data.sql b/data.sql index 237b6b3..3cce885 100644 --- a/data.sql +++ b/data.sql @@ -64,12 +64,17 @@ CREATE TABLE IF NOT EXISTS policies ( id serial PRIMARY KEY, name varchar(50) NOT NULL, source_id integer, - is_default boolean default false, + user_id integer, + + CONSTRAINT policy_user_id_fkey FOREIGN KEY (user_id) + REFERENCES users(id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION, CONSTRAINT policy_source_id_fkey FOREIGN KEY (source_id) REFERENCES sources(id) MATCH SIMPLE ON UPDATE NO ACTION ON DELETE NO ACTION, + is_default boolean default false, createdAt timestamp NOT NULL DEFAULT NOW(), updatedAt timestamp ); @@ -94,8 +99,12 @@ CREATE TABLE IF NOT EXISTS policy_fields( CREATE TABLE IF NOT EXISTS groups ( id serial PRIMARY KEY, - name varchar(50) NOT NULL, + user_id integer, + + CONSTRAINT groups_user_id_fkey FOREIGN KEY (user_id) + REFERENCES users(id) MATCH SIMPLE + ON UPDATE NO ACTION ON DELETE NO ACTION, createdAt timestamp NOT NULL DEFAULT NOW(), updatedAt timestamp