CREATE TABLE JCR_LOCKS(
  WS_NAME VARCHAR(96) NOT NULL,
  NODE_ID VARCHAR(96) NOT NULL,
  TOKEN_HASH VARCHAR(32) NOT NULL,
  OWNER VARCHAR(96) NOT NULL,
  IS_SESSIONSCOPED CHAR NOT NULL,
  IS_DEEP CHAR NOT NULL,
  BIRTHDAY BIGINT NOT NULL,
  TIMEOUT BIGINT NOT NULL,
  CONSTRAINT JCR_PK_LOCK PRIMARY KEY(NODE_ID, WS_NAME)
);
CREATE INDEX JCR_ALL_WS_LOCKS ON JCR_LOCKS(WS_NAME, NODE_ID);
CREATE INDEX JCR_LOCKS_BY_ID ON JCR_LOCKS(NODE_ID);
