 	END IF;
 END;
 /
-ALTER TRIGGER "FUNDMASTER"."TR_ANID2USERCLAIMS_INS" ENABLE;
+ALTER TRIGGER "TR_ANID2USERCLAIMS_INS" ENABLE;
 
 
 
 --
-CREATE TABLE "FUNDMASTER"."ANID2USERLOGINS"
+CREATE TABLE "ANID2USERLOGINS"
 (
 	"LOGINPROVIDER" VARCHAR2(128 BYTE) NOT NULL,
 	"PROVIDERKEY"   VARCHAR2(128 BYTE) NOT NULL,
 	"USERID"        VARCHAR2(128 BYTE) NOT NULL
 );
-CREATE INDEX "FUNDMASTER"."PK_ANID2USERLOGINS_USERID" ON "FUNDMASTER"."ANID2USERLOGINS" ("LOGINPROVIDER","PROVIDERKEY","USERID");
-ALTER TABLE "FUNDMASTER"."ANID2USERLOGINS" ADD  PRIMARY KEY ("LOGINPROVIDER","PROVIDERKEY","USERID");
+CREATE INDEX "PK_ANID2USERLOGINS_USERID" ON "ANID2USERLOGINS" ("LOGINPROVIDER","PROVIDERKEY","USERID");
+ALTER TABLE "ANID2USERLOGINS" ADD  PRIMARY KEY ("LOGINPROVIDER","PROVIDERKEY","USERID");
 
-CREATE INDEX "FUNDMASTER"."FK_ANID2USERLOGINS_USERID" ON "FUNDMASTER"."ANID2USERLOGINS" ("USERID");
-ALTER TABLE "FUNDMASTER"."ANID2USERLOGINS" ADD CONSTRAINT "FK_ANID2USERLOGINS_USERID" FOREIGN KEY ("USERID")
-  REFERENCES "FUNDMASTER"."ANID2USERS" ("ID") ON DELETE CASCADE ENABLE;
+CREATE INDEX "FK_ANID2USERLOGINS_USERID" ON "ANID2USERLOGINS" ("USERID");
+ALTER TABLE "ANID2USERLOGINS" ADD CONSTRAINT "FK_ANID2USERLOGINS_USERID" FOREIGN KEY ("USERID")
+  REFERENCES "ANID2USERS" ("ID") ON DELETE CASCADE ENABLE;
 
 
 
 --
-CREATE TABLE "FUNDMASTER"."ANID2USERROLES"
+CREATE TABLE "ANID2USERROLES"
 (
 	"USERID" VARCHAR2(128 BYTE) NOT NULL,
 	"ROLEID" VARCHAR2(128 BYTE) NOT NULL
 ) ;
-CREATE UNIQUE INDEX "FUNDMASTER"."PK_ANID2USERROLES_ID" ON "FUNDMASTER"."ANID2USERROLES" ("USERID","ROLEID");
-ALTER TABLE "FUNDMASTER"."ANID2USERROLES" ADD CONSTRAINT "PK_ANID2USERROLES_USERID" PRIMARY KEY ("USERID","ROLEID");
+CREATE UNIQUE INDEX "PK_ANID2USERROLES_ID" ON "ANID2USERROLES" ("USERID","ROLEID");
+ALTER TABLE "ANID2USERROLES" ADD CONSTRAINT "PK_ANID2USERROLES_USERID" PRIMARY KEY ("USERID","ROLEID");
 
-CREATE INDEX "FUNDMASTER"."FK_ANID2USERROLES_ROLEID" ON "FUNDMASTER"."ANID2USERROLES" ("ROLEID");
-ALTER TABLE "FUNDMASTER"."ANID2USERROLES" ADD CONSTRAINT "FK_ANID2USERROLES_USERID" FOREIGN KEY ("USERID")
-  REFERENCES "FUNDMASTER"."ANID2USERS" ("ID") ON DELETE CASCADE ENABLE;
+CREATE INDEX "FK_ANID2USERROLES_ROLEID" ON "ANID2USERROLES" ("ROLEID");
+ALTER TABLE "ANID2USERROLES" ADD CONSTRAINT "FK_ANID2USERROLES_USERID" FOREIGN KEY ("USERID")
+  REFERENCES "ANID2USERS" ("ID") ON DELETE CASCADE ENABLE;
 
-ALTER TABLE "FUNDMASTER"."ANID2USERROLES" ADD CONSTRAINT "FK_ANID2USERROLES_ROLEID" FOREIGN KEY ("ROLEID")
-  REFERENCES "FUNDMASTER"."ANID2ROLES" ("ID") ON DELETE CASCADE ENABLE;
+ALTER TABLE "ANID2USERROLES" ADD CONSTRAINT "FK_ANID2USERROLES_ROLEID" FOREIGN KEY ("ROLEID")
+  REFERENCES "ANID2ROLES" ("ID") ON DELETE CASCADE ENABLE;
 



--
CREATE TABLE "FUNDMASTER"."ANID2ROLES"
(
	"ID"   VARCHAR2(128 BYTE) NOT NULL,
	"NAME" VARCHAR2(256 BYTE) NOT NULL
);
CREATE UNIQUE INDEX "FUNDMASTER"."PK_ANID2ROLES_ID" ON "FUNDMASTER"."ANID2ROLES" ("ID");
ALTER TABLE "FUNDMASTER"."ANID2ROLES" ADD CONSTRAINT "PK_ANID2ROLES_ID" PRIMARY KEY ("ID");



--
CREATE TABLE "FUNDMASTER"."ANID2USERS"
(
	"ID"             VARCHAR2(128 BYTE) NOT NULL,
	"EMAIL"          VARCHAR2(256 BYTE) DEFAULT NULL,

	"ACCESSFAILEDCOUNT"    NUMBER(10, 0) NOT NULL,
	"USERNAME"             VARCHAR2(256 BYTE) NOT NULL
);
CREATE UNIQUE INDEX "PK_ANID2USERS_ID" ON "ANID2USERS" ("ID");
ALTER TABLE "ANID2USERS" ADD CONSTRAINT "PK_ANID2USERS_ID" PRIMARY KEY ("ID");



--
CREATE TABLE "ANID2USERCLAIMS"
(
	"ID"     NUMBER(10, 0) NOT NULL,
	"USERID" VARCHAR2(128 BYTE) NOT NULL,
	"CLAIMTYPE" CLOB,
	"CLAIMVALUE" CLOB
);
CREATE UNIQUE INDEX "PK_ANID2USERCLAIMS_ID" ON "ANID2USERCLAIMS" ("ID");
ALTER TABLE "ANID2USERCLAIMS" ADD CONSTRAINT "PK_ANID2USERCLAIMS_ID" PRIMARY KEY ("ID");

CREATE INDEX "FK_ANID2USERCLAIMS_USERID" ON "ANID2USERCLAIMS" ("USERID");
ALTER TABLE "ANID2USERCLAIMS" ADD CONSTRAINT "FK_ANID2USERCLAIMS_USERID" FOREIGN KEY ("USERID")
  REFERENCES "ANID2USERS" ("ID") ON DELETE CASCADE ENABLE;

CREATE SEQUENCE "SEQ_ANID2USERCLAIMS_ID"
START WITH 1
INCREMENT BY 1
NOMAXVALUE; 

CREATE OR REPLACE TRIGGER "TR_ANID2USERCLAIMS_INS" 
	BEFORE INSERT
	ON "ANID2USERCLAIMS"
	REFERENCING NEW AS new OLD AS old
	FOR EACH ROW
BEGIN
