/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BOS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BAS_USER_PARAS_CONFIG' AND KSQL_COL_NAME ='FTABLEALLENABLE') 
 ALTER TABLE T_BAS_USER_PARAS_CONFIG ADD (FTABLEALLENABLE CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BAS_USER_PARAS_CONFIG' AND KSQL_COL_NAME ='FTABLEISGRIDSTRIPED') 
 ALTER TABLE T_BAS_USER_PARAS_CONFIG ADD (FTABLEISGRIDSTRIPED CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BAS_USER_PARAS_CONFIG' AND KSQL_COL_NAME ='FTABLEVERTICAL') 
 ALTER TABLE T_BAS_USER_PARAS_CONFIG ADD (FTABLEVERTICAL CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BAS_USER_PARAS_CONFIG' AND KSQL_COL_NAME ='FTABLEDISPLAYMODE') 
 ALTER TABLE T_BAS_USER_PARAS_CONFIG ADD (FTABLEDISPLAYMODE NVARCHAR(30) DEFAULT 'adaptive' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_BAS_USER_PARAS_CONFIG' AND KSQL_COL_NAME ='FTABLEROWHIGH') 
 ALTER TABLE T_BAS_USER_PARAS_CONFIG ADD (FTABLEROWHIGH INT DEFAULT 32 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SEC_GRAYAPPUSERGROUP') 
 CREATE TABLE T_SEC_GRAYAPPUSERGROUP (
FPKID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SEC_GRAYGROUP') 
 CREATE TABLE T_SEC_GRAYGROUP (
FID BIGINT DEFAULT 0 NOT NULL,
FNUMBER VARCHAR(50) DEFAULT ' ' NOT NULL,
FNAME VARCHAR(50) DEFAULT ' ' NOT NULL,
FDESCRIPTION VARCHAR(255) DEFAULT ' ' NOT NULL
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SEC_GRAYGROUP_USER') 
 CREATE TABLE T_SEC_GRAYGROUP_USER (
FPKID BIGINT DEFAULT 0 NOT NULL,
FID BIGINT DEFAULT 0 NOT NULL,
FBASEDATAID BIGINT DEFAULT 0 NOT NULL
);



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\BOS_table.sql **/
