From cd07dabd0c771c2dfa83163d434f6f37487bfd59 Mon Sep 17 00:00:00 2001 From: roland-sipos Date: Fri, 29 Oct 2021 11:06:17 +0200 Subject: [PATCH] sql --- runregistry-rest/runregistry_table.sql | 26 -------------------------- runregistry-rest/sql/runreg-blob.sql | 19 +++++++++++++++++++ runregistry-rest/sql/runreg-meta.sql | 24 ++++++++++++++++++++++++ 3 files changed, 43 insertions(+), 26 deletions(-) delete mode 100644 runregistry-rest/runregistry_table.sql create mode 100644 runregistry-rest/sql/runreg-blob.sql create mode 100644 runregistry-rest/sql/runreg-meta.sql diff --git a/runregistry-rest/runregistry_table.sql b/runregistry-rest/runregistry_table.sql deleted file mode 100644 index a601d37..0000000 --- a/runregistry-rest/runregistry_table.sql +++ /dev/null @@ -1,26 +0,0 @@ --------------------------------------------------------- --- File created - Monday-October-18-2021 --------------------------------------------------------- --------------------------------------------------------- --- DDL for Table RUN_REGISTRY --------------------------------------------------------- - - CREATE TABLE "RUN_REGISTRY" ("RUN_NUMBER" NUMBER, "START_TIME" TIMESTAMP (6), "STOP_TIME" TIMESTAMP (6) DEFAULT NULL, "DETECTOR_ID" VARCHAR2(40), "RUN_TYPE" VARCHAR2(40), "FILENAME" VARCHAR2(100), "CONFIGURATION" BLOB) --------------------------------------------------------- --- DDL for Index RUN_REGISTRY_PK --------------------------------------------------------- - - CREATE UNIQUE INDEX "RUN_REGISTRY_PK" ON "RUN_REGISTRY" ("RUN_NUMBER") --------------------------------------------------------- --- Constraints for Table RUN_REGISTRY --------------------------------------------------------- - - ALTER TABLE "RUN_REGISTRY" MODIFY ("RUN_NUMBER" NOT NULL ENABLE) - ALTER TABLE "RUN_REGISTRY" MODIFY ("START_TIME" NOT NULL ENABLE) - ALTER TABLE "RUN_REGISTRY" MODIFY ("DETECTOR_ID" NOT NULL ENABLE) - ALTER TABLE "RUN_REGISTRY" MODIFY ("RUN_TYPE" NOT NULL ENABLE) - ALTER TABLE "RUN_REGISTRY" MODIFY ("FILENAME" NOT NULL ENABLE) - ALTER TABLE "RUN_REGISTRY" ADD CONSTRAINT "RUN_REGISTRY_PK" PRIMARY KEY ("RUN_NUMBER") USING INDEX ENABLE - ALTER TABLE "RUN_REGISTRY" MODIFY ("CONFIGURATION" NOT NULL ENABLE) - - diff --git a/runregistry-rest/sql/runreg-blob.sql b/runregistry-rest/sql/runreg-blob.sql new file mode 100644 index 0000000..d7be17a --- /dev/null +++ b/runregistry-rest/sql/runreg-blob.sql @@ -0,0 +1,19 @@ +-------------------------------------------------------- +-- File created - Friday-October-29-2021 +-------------------------------------------------------- +-------------------------------------------------------- +-- DDL for Table RUN_REGISTRY_CONFIGS +-------------------------------------------------------- + + CREATE TABLE "RUN_REGISTRY_CONFIGS" ("RUN_NUMBER" NUMBER, "CONFIGURATION" BLOB) LOB ("CONFIGURATION") STORE AS SECUREFILE "SYS_LOB0436808964C00002$$"(ENABLE STORAGE IN ROW CHUNK 8192 NOCACHE LOGGING NOCOMPRESS KEEP_DUPLICATES ) +-------------------------------------------------------- +-- Constraints for Table RUN_REGISTRY_CONFIGS +-------------------------------------------------------- + + ALTER TABLE "RUN_REGISTRY_CONFIGS" MODIFY ("RUN_NUMBER" NOT NULL ENABLE) + ALTER TABLE "RUN_REGISTRY_CONFIGS" MODIFY ("CONFIGURATION" NOT NULL ENABLE) +-------------------------------------------------------- +-- Ref Constraints for Table RUN_REGISTRY_CONFIGS +-------------------------------------------------------- + + ALTER TABLE "RUN_REGISTRY_CONFIGS" ADD CONSTRAINT "RUN_REGISTRY_CONFIGS_FK1" FOREIGN KEY ("RUN_NUMBER") REFERENCES "RUN_REGISTRY_META" ("RUN_NUMBER") ENABLE diff --git a/runregistry-rest/sql/runreg-meta.sql b/runregistry-rest/sql/runreg-meta.sql new file mode 100644 index 0000000..7eaeb89 --- /dev/null +++ b/runregistry-rest/sql/runreg-meta.sql @@ -0,0 +1,24 @@ +-------------------------------------------------------- +-- File created - Friday-October-29-2021 +-------------------------------------------------------- +-------------------------------------------------------- +-- DDL for Table RUN_REGISTRY_META +-------------------------------------------------------- + + CREATE TABLE "RUN_REGISTRY_META" ("RUN_NUMBER" NUMBER, "START_TIME" TIMESTAMP (6), "STOP_TIME" TIMESTAMP (6), "DETECTOR_ID" VARCHAR2(40), "RUN_TYPE" VARCHAR2(40), "FILENAME" VARCHAR2(100), "SOFTWARE_VERSION" VARCHAR2(40)) +-------------------------------------------------------- +-- DDL for Index RUN_REGISTRY_META_PK +-------------------------------------------------------- + + CREATE UNIQUE INDEX "RUN_REGISTRY_META_PK" ON "RUN_REGISTRY_META" ("RUN_NUMBER") +-------------------------------------------------------- +-- Constraints for Table RUN_REGISTRY_META +-------------------------------------------------------- + + ALTER TABLE "RUN_REGISTRY_META" ADD CONSTRAINT "RUN_REGISTRY_META_PK" PRIMARY KEY ("RUN_NUMBER") USING INDEX ENABLE + ALTER TABLE "RUN_REGISTRY_META" MODIFY ("RUN_NUMBER" NOT NULL ENABLE) + ALTER TABLE "RUN_REGISTRY_META" MODIFY ("START_TIME" NOT NULL ENABLE) + ALTER TABLE "RUN_REGISTRY_META" MODIFY ("DETECTOR_ID" NOT NULL ENABLE) + ALTER TABLE "RUN_REGISTRY_META" MODIFY ("RUN_TYPE" NOT NULL ENABLE) + ALTER TABLE "RUN_REGISTRY_META" MODIFY ("FILENAME" NOT NULL ENABLE) + ALTER TABLE "RUN_REGISTRY_META" MODIFY ("SOFTWARE_VERSION" NOT NULL ENABLE)