DROP TABLE IF EXISTS IDN_AUTH_SESSION_STORE;
CREATE TABLE IF NOT EXISTS IDN_AUTH_SESSION_STORE (
  SESSION_ID VARCHAR(100) DEFAULT NULL,
  SESSION_TYPE VARCHAR(100) DEFAULT NULL,
  SESSION_OBJECT BYTEA,
  TIME_CREATED TIMESTAMP,
  PRIMARY KEY (SESSION_ID, SESSION_TYPE)
);

UPDATE IDP_AUTHENTICATOR SET NAME='samlsso' WHERE NAME = 'saml2sso' AND TENANT_ID = '-1234';

ALTER TABLE IDP_PROVISIONING_ENTITY DROP CONSTRAINT IDP_PROVISIONING_ENTITY_ENTITY_TYPE_TENANT_ID_ENTITY_LOCAL__KEY;

ALTER TABLE IDP_PROVISIONING_ENTITY ADD CONSTRAINT IDP_PROVISIONING_ENTITY_ENTITY_TYPE_TENANT_ID_ENTITY_LOCAL__KEY UNIQUE(ENTITY_TYPE, TENANT_ID, ENTITY_LOCAL_USERSTORE, ENTITY_NAME, PROVISIONING_CONFIG_ID);