
-- DROP TABLE "CERTIFICATES_REGISTRY";
-- DROP SEQUENCE "AUTHENTICATION_CERTS_SEQ";
--------------------------------------------------------
--  DDL for Sequence CERTIFICATES_REGISTRY_SEQ
--------------------------------------------------------

   CREATE SEQUENCE  "CERTIFICATES_REGISTRY_SEQ"  MINVALUE 1 MAXVALUE 9999999999999999999999999999 INCREMENT BY 1 START WITH 1 NOCACHE  NOORDER  NOCYCLE ;

--------------------------------------------------------
--  DDL for Table AUTHENTICATION_CERTS
--------------------------------------------------------


  CREATE TABLE "CERTIFICATES_REGISTRY"
   (
   "ID" NUMBER(11,0),
	 "CERTIFICATE_NAME" VARCHAR2(100 BYTE),
	 "PLATFORM_NAME" VARCHAR2(100 BYTE),
   "TENANT_ID" VARCHAR2(100 BYTE), 
	 "ELECTION_EVENT_ID" VARCHAR2(100 BYTE), 
	 "CERTIFICATE_CONTENT" CLOB
   ) ;

--------------------------------------------------------
--  DDL for Index CERTIFICATES_REGISTRY_UK1
--------------------------------------------------------
  CREATE UNIQUE INDEX "CERTIFICATES_REGISTRY_UK1" ON "CERTIFICATES_REGISTRY" ("CERTIFICATE_NAME","PLATFORM_NAME","TENANT_ID");


--------------------------------------------------------
--  Constraints for Table CERTIFICATES_REGISTRY
--------------------------------------------------------

  ALTER TABLE "CERTIFICATES_REGISTRY" ADD CONSTRAINT "CERTIFICATES_REGISTRY_UK1" UNIQUE ("CERTIFICATE_NAME","PLATFORM_NAME","TENANT_ID");
  ALTER TABLE "CERTIFICATES_REGISTRY" ADD PRIMARY KEY ("ID") ENABLE;
  ALTER TABLE "CERTIFICATES_REGISTRY" MODIFY ("CERTIFICATE_CONTENT" NOT NULL ENABLE);
  ALTER TABLE "CERTIFICATES_REGISTRY" MODIFY ("CERTIFICATE_NAME" NOT NULL ENABLE);
  ALTER TABLE "CERTIFICATES_REGISTRY" MODIFY ("ID" NOT NULL ENABLE);
