/**Begin D:\PDM_UPGRADE\pdm_new\BOS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PERM_USRGRPREL_RULEENT')
 CREATE TABLE T_PERM_USRGRPREL_RULEENT (
FID BIGINT DEFAULT 0 NOT NULL,
FUSRGRPID BIGINT DEFAULT 0 NOT NULL,
FSRCENTITY VARCHAR(36) DEFAULT ' ' NOT NULL,
FUSERFIELDKEY VARCHAR(50) DEFAULT ' ' NOT NULL,
FRULE NCLOB,
FRULE_TAG NCLOB,
FISCOMPLEXRULE CHAR(1) DEFAULT '0' NOT NULL,
FGRPREFFIELDKEY VARCHAR(50) DEFAULT ' ' NOT NULL,
FGRPREFBDTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FGRPREFVALUE VARCHAR(50) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PERM_USRGRPSTD')
 CREATE TABLE T_PERM_USRGRPSTD (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(100) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSTATUS NVARCHAR(30) DEFAULT ' ' NOT NULL,
FCREATETIME DATETIME,
FMODIFYTIME DATETIME,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PERM_USRGRPSTD_L')
 CREATE TABLE T_PERM_USRGRPSTD_L (
FPKID VARCHAR(18) DEFAULT ' ' NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FLOCALEID VARCHAR(10) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FDESCRIPTION NVARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PERM_USRGRPSTD_RELSYN')
 CREATE TABLE T_PERM_USRGRPSTD_RELSYN (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FSRCENTITY VARCHAR(36) DEFAULT ' ' NOT NULL,
FUSERFIELDKEY VARCHAR(50) DEFAULT ' ' NOT NULL
);



/**End D:\PDM_UPGRADE\pdm_new\BOS_table.sql **/
