/**Begin D:\PDM_UPGRADE\pdm_new\BOS_table.sql **/
IF EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PERM_ROLEFIELDSCHEME')
DROP TABLE T_PERM_ROLEFIELDSCHEME;
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PERM_ROLEFIELDSCHEME')
CREATE TABLE T_PERM_ROLEFIELDSCHEME (
FID BIGINT DEFAULT 0 NOT NULL,
FROLEID VARCHAR(18) DEFAULT ' ' NOT NULL,
FFIELDPERMSCHEMEID BIGINT DEFAULT 0 NOT NULL,
FAPPID VARCHAR(36) DEFAULT ' ' NOT NULL,
FENTNUM VARCHAR(36) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME
);

IF EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PERM_USERFIELDSCHEME')
DROP TABLE T_PERM_USERFIELDSCHEME;
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PERM_USERFIELDSCHEME')
CREATE TABLE T_PERM_USERFIELDSCHEME (
FID BIGINT DEFAULT 0 NOT NULL,
FUSERID BIGINT DEFAULT 0 NOT NULL,
FFIELDPERMSCHEMEID BIGINT DEFAULT 0 NOT NULL,
FAPPID VARCHAR(36) DEFAULT ' ' NOT NULL,
FENTNUM VARCHAR(36) DEFAULT ' ' NOT NULL,
FDIMTYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FDIMID BIGINT DEFAULT 0 NOT NULL,
FINCLUDESUB CHAR(1) DEFAULT '0' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME
);

IF EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PERM_FIELDSCHEME')
DROP TABLE T_PERM_FIELDSCHEME;
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PERM_FIELDSCHEME')
CREATE TABLE T_PERM_FIELDSCHEME (
FID BIGINT DEFAULT 0 NOT NULL,
FMASTERID BIGINT DEFAULT 0 NOT NULL,
FNUMBER NVARCHAR(30) DEFAULT ' ' NOT NULL,
FNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FFIELDFROM VARCHAR(10) DEFAULT '2' NOT NULL,
FCONTROLFIELDTYPE VARCHAR(255) DEFAULT ' ' NOT NULL,
FCONTROLMODE VARCHAR(10) DEFAULT ' ' NOT NULL,
FAPPID VARCHAR(36) DEFAULT ' ' NOT NULL,
FENTNUM VARCHAR(36) DEFAULT ' ' NOT NULL,
FSENSITIVE CHAR(1) DEFAULT '0' NOT NULL,
FSTATUS NVARCHAR(30) DEFAULT 'C' NOT NULL,
FENABLE CHAR(1) DEFAULT '1' NOT NULL,
FISSYSTEM CHAR(1) DEFAULT '0' NOT NULL,
FDESC VARCHAR(255) DEFAULT ' ' NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FMODIFIERID BIGINT DEFAULT 0 NOT NULL,
FMODIFYTIME DATETIME
);

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

IF EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PERM_FIELDSCHEMED')
DROP TABLE T_PERM_FIELDSCHEMED;
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_PERM_FIELDSCHEMED')
CREATE TABLE T_PERM_FIELDSCHEMED (
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FFIELDNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FCONTROLMODE VARCHAR(10) DEFAULT ' ' NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL
);



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