/**Begin D:\PDM_UPGRADE\PDM1\FCS_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FCS_SAFETYINSPECT_R' AND KSQL_COL_NAME IN ('FDEALER'))
 ALTER TABLE T_FCS_SAFETYINSPECT_R ADD (FDEALER NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FCS_SAFETYINSPECT_R' AND KSQL_COL_NAME IN ('FDEALTIME'))
 ALTER TABLE T_FCS_SAFETYINSPECT_R ADD (FDEALTIME DATETIME );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FCS_SAFETYINSPECT_R' AND KSQL_COL_NAME IN ('FREASONTYPE'))
 ALTER TABLE T_FCS_SAFETYINSPECT_R ADD (FREASONTYPE NVARCHAR(30) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FCS_SAFETYINSPECT_R' AND KSQL_COL_NAME IN ('FREASON'))
 ALTER TABLE T_FCS_SAFETYINSPECT_R ADD (FREASON NVARCHAR(255) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FCS_SAFETYINSPECT_R' AND KSQL_COL_NAME IN ('FREASON_TAG'))
 ALTER TABLE T_FCS_SAFETYINSPECT_R ADD (FREASON_TAG NCLOB );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FCS_TENANTWHITE')
 CREATE TABLE T_FCS_TENANTWHITE (
FID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME,
FENABLE NVARCHAR(30) DEFAULT ' ' NOT NULL,
FTENANT NVARCHAR(50) DEFAULT ' ' NOT NULL,
FREMARK NVARCHAR(255) DEFAULT ' ' NOT NULL
);



/**End D:\PDM_UPGRADE\PDM1\FCS_table.sql **/
