aboutsummaryrefslogtreecommitdiffstats
path: root/src/main/docker/postgres_scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/docker/postgres_scripts')
-rw-r--r--src/main/docker/postgres_scripts/Dockerfile7
-rw-r--r--src/main/docker/postgres_scripts/createdb.sql25
-rw-r--r--src/main/docker/postgres_scripts/init_db.sh3
3 files changed, 35 insertions, 0 deletions
diff --git a/src/main/docker/postgres_scripts/Dockerfile b/src/main/docker/postgres_scripts/Dockerfile
new file mode 100644
index 0000000..9ccb016
--- /dev/null
+++ b/src/main/docker/postgres_scripts/Dockerfile
@@ -0,0 +1,7 @@
+from busybox
+
+RUN mkdir /docker-entrypoint-initdb.d
+
+ADD createdb.sql /tmp
+
+
diff --git a/src/main/docker/postgres_scripts/createdb.sql b/src/main/docker/postgres_scripts/createdb.sql
new file mode 100644
index 0000000..dc843e7
--- /dev/null
+++ b/src/main/docker/postgres_scripts/createdb.sql
@@ -0,0 +1,25 @@
+CREATE DATABASE sonh_ms;
+\c sonh_ms
+CREATE TABLE DMAAP_NOTIFICATIONS(
+ notification TEXT PRIMARY KEY NOT NULL,
+ created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
+);
+CREATE TABLE BUFFERED_NOTIFICATIONS(
+ notification TEXT PRIMARY KEY NOT NULL,
+ cluster_id TEXT NOT NULL,
+ created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
+);
+CREATE TABLE CLUSTER_DETAILS(
+ cluster_id TEXT PRIMARY KEY NOT NULL,
+ cluster_info TEXT NOT NULL,
+ child_thread_id BIGINT UNIQUE NOT NULL
+);
+CREATE TABLE CELL_INFO(
+ cell_id TEXT PRIMARY KEY NOT NULL,
+ pnf_name TEXT NOT NULL
+);
+CREATE TABLE PCI_REQUESTS(
+ transaction_id TEXT PRIMARY KEY,
+ child_thread_id BIGINT UNIQUE NOT NULL
+);
+
diff --git a/src/main/docker/postgres_scripts/init_db.sh b/src/main/docker/postgres_scripts/init_db.sh
new file mode 100644
index 0000000..cbc27a6
--- /dev/null
+++ b/src/main/docker/postgres_scripts/init_db.sh
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+psql -U postgres -tc "SELECT 1 FROM pg_database WHERE datname = 'pci_ms'" | grep -q 1 || psql -U postgres -c "CREATE DATABASE pci_ms"