sql scripts
This commit is contained in:
parent
87fec1e321
commit
a853b89ca4
|
@ -0,0 +1,25 @@
|
|||
-- TODO: This variable should be obtained from the system ENV
|
||||
\set DB dnet_index_configs
|
||||
CREATE DATABASE :DB;
|
||||
\c :DB
|
||||
|
||||
BEGIN;
|
||||
|
||||
CREATE TABLE index_configurations (
|
||||
id text PRIMARY KEY,
|
||||
solr_config text NOT NULL,
|
||||
description text,
|
||||
n_shards int NOT NULL DEFAULT 1,
|
||||
n_replicas int NOT NULL DEFAULT 1
|
||||
);
|
||||
|
||||
CREATE TABLE index_fields (
|
||||
idx_id text NOT NULL,
|
||||
name text NOT NULL,
|
||||
constant text,
|
||||
xpath text,
|
||||
result boolean NOT NULL DEFAULT true,
|
||||
PRIMARY KEY (idx_id, name)
|
||||
);
|
||||
|
||||
COMMIT;
|
|
@ -0,0 +1,38 @@
|
|||
-- TODO: This variable should be obtained from the system ENV
|
||||
\set DB dnet_oai
|
||||
CREATE DATABASE :DB;
|
||||
\c :DB
|
||||
|
||||
BEGIN;
|
||||
|
||||
CREATE TABLE oai_md_formats (
|
||||
prefix text PRIMARY KEY,
|
||||
schema text NOT NULL,
|
||||
namespace text NOT NULL,
|
||||
xslt text
|
||||
);
|
||||
|
||||
CREATE TABLE oai_sets (
|
||||
set_spec text PRIMARY KEY,
|
||||
set_name text NOT NULL,
|
||||
description text,
|
||||
ds_id text
|
||||
);
|
||||
|
||||
CREATE TABLE oai_conf (
|
||||
id int PRIMARY KEY DEFAULT 0,
|
||||
repository_name text NOT NULL,
|
||||
public_baseurl text NOT NULL,
|
||||
admin_email text NOT NULL,
|
||||
native_format text NOT NULL REFERENCES oai_md_formats(prefix)
|
||||
);
|
||||
|
||||
|
||||
CREATE TABLE oai_records (
|
||||
id text PRIMARY KEY,
|
||||
body text NOT NULL,
|
||||
date timestamp NOT NULL DEFAULT now(),
|
||||
oai_set text NOT NULL REFERENCES oai_set(set_spec)
|
||||
);
|
||||
|
||||
COMMIT;
|
|
@ -54,7 +54,7 @@ services:
|
|||
depends_on:
|
||||
- db-main
|
||||
environment:
|
||||
- SPRING_DATASOURCE_URL=jdbc:postgresql://db-main:${PG_PORT}/${PG_MAIN_DB}
|
||||
- SPRING_DATASOURCE_URL=jdbc:postgresql://db-main:${PG_PORT}/${PG_INDEX_DB}
|
||||
- SPRING_DATASOURCE_USERNAME=${PG_USER}
|
||||
- SPRING_DATASOURCE_PASSWORD=${PG_PASSWORD}
|
||||
profiles:
|
||||
|
@ -86,9 +86,9 @@ services:
|
|||
networks:
|
||||
- backend
|
||||
depends_on:
|
||||
- db-main
|
||||
- db-oai
|
||||
environment:
|
||||
- SPRING_DATASOURCE_URL=jdbc:postgresql://db-main:${PG_PORT}/${PG_MAIN_DB}
|
||||
- SPRING_DATASOURCE_URL=jdbc:postgresql://db-oai:${PG_PORT}/${PG_OAI_DB}
|
||||
- SPRING_DATASOURCE_USERNAME=${PG_USER}
|
||||
- SPRING_DATASOURCE_PASSWORD=${PG_PASSWORD}
|
||||
profiles:
|
||||
|
@ -168,6 +168,7 @@ services:
|
|||
POSTGRES_DB_VOCS: ${PG_VOCS_DB}
|
||||
POSTGRES_DB_CONTEXTS: ${PG_CONTEXTS_DB}
|
||||
POSTGRES_DB_MDSTORES: ${PG_MDSTORES_DB}
|
||||
POSTGRES_DB_INDEX: ${PG_INDEX_DB}
|
||||
volumes:
|
||||
- pg_main_data:/var/lib/postgresql/data
|
||||
- ./data/sql/resources.sql:/docker-entrypoint-initdb.d/init_01_resources.sql
|
||||
|
@ -176,10 +177,29 @@ services:
|
|||
- ./data/sql/vocabularies.sql:/docker-entrypoint-initdb.d/init_04_vocabularies.sql
|
||||
- ./data/sql/contexts.sql:/docker-entrypoint-initdb.d/init_05_contexts.sql
|
||||
- ./data/sql/mdstores.sql:/docker-entrypoint-initdb.d/init_06_mdstores.sql
|
||||
- ./data/sql/instances/openportals.sql:/docker-entrypoint-initdb.d/init_07_openportals.sql
|
||||
- ./data/sql/index_configs.sql:/docker-entrypoint-initdb.d/init_07_index_configs.sql
|
||||
- ./data/sql/instances/openportals.sql:/docker-entrypoint-initdb.d/init_99_openportals.sql
|
||||
profiles:
|
||||
- base
|
||||
|
||||
db-oai:
|
||||
image: postgres:15.4
|
||||
restart: always
|
||||
expose:
|
||||
- ${PG_PORT}
|
||||
networks:
|
||||
- backend
|
||||
environment:
|
||||
POSTGRES_DB: ${PG_OAI_DB}
|
||||
POSTGRES_USER: ${PG_USER}
|
||||
POSTGRES_PASSWORD: ${PG_PASSWORD}
|
||||
volumes:
|
||||
- ./data/sql/oai.sql:/docker-entrypoint-initdb.d/init.sql
|
||||
- pg_oai_data:/var/lib/postgresql/data
|
||||
profiles:
|
||||
- oai
|
||||
- wfs
|
||||
|
||||
db-mdstores-data:
|
||||
image: postgres:15.4
|
||||
restart: always
|
||||
|
@ -197,7 +217,7 @@ services:
|
|||
profiles:
|
||||
- mdstores
|
||||
- wfs
|
||||
|
||||
|
||||
solr-1:
|
||||
image: solr:9.4.0
|
||||
container_name: solr-1
|
||||
|
@ -288,5 +308,6 @@ volumes:
|
|||
solrdata:
|
||||
pg_main_data:
|
||||
pg_mdstores_data:
|
||||
pg_oai_data:
|
||||
zoo1data:
|
||||
|
2
start.sh
2
start.sh
|
@ -16,6 +16,8 @@ export PG_WFS_DB=dnet_wfs
|
|||
export PG_VOCS_DB=dnet_vocabularies
|
||||
export PG_CONTEXTS_DB=dnet_contexts
|
||||
export PG_MDSTORES_DATA_DB=dnet_mdstores_data
|
||||
export PG_INDEX_DB=dnet_index_configs
|
||||
export PG_OAI_DB=dnet_oai
|
||||
|
||||
export COMPOSE_PROFILES=base,index
|
||||
#export COMPOSE_PROFILES=base,mail,dsm,vocs,mdstores,wfs,index,contexts,ui
|
||||
|
|
Loading…
Reference in New Issue