/**Begin C:\PDM_UPGRADE\PDM1\SRC_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PROJECT' AND KSQL_COL_NAME IN ('FNODENAME')) 
 ALTER TABLE T_SRC_PROJECT ADD (FNODENAME NVARCHAR(50) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PROJECT' AND KSQL_COL_NAME IN ('FISVIEPUBLISH')) 
 ALTER TABLE T_SRC_PROJECT ADD (FISVIEPUBLISH CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PROJECT' AND KSQL_COL_NAME IN ('FISBIDPUBLISH')) 
 ALTER TABLE T_SRC_PROJECT ADD (FISBIDPUBLISH CHAR(1) DEFAULT '0' NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_ENROLLSUPPLIER' AND KSQL_COL_NAME IN ('FISAPTPUSH')) 
 ALTER TABLE T_SRC_ENROLLSUPPLIER ADD (FISAPTPUSH CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_ENROLLSUPPLIER' AND KSQL_COL_NAME IN ('FISAPTPUSH2')) 
 ALTER TABLE T_SRC_ENROLLSUPPLIER ADD (FISAPTPUSH2 CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_ENROLLSUPPLIER' AND KSQL_COL_NAME IN ('FISBIDPUSH')) 
 ALTER TABLE T_SRC_ENROLLSUPPLIER ADD (FISBIDPUSH CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_INVITESUPPLIER' AND KSQL_COL_NAME IN ('FCURRENTRANK')) 
 ALTER TABLE T_SRC_INVITESUPPLIER ADD (FCURRENTRANK INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_INVITESUPPLIER' AND KSQL_COL_NAME IN ('FSUMSCORE')) 
 ALTER TABLE T_SRC_INVITESUPPLIER ADD (FSUMSCORE DECIMAL(19,4) DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_INVITESUPPLIER' AND KSQL_COL_NAME IN ('FISBIDPUBLISH')) 
 ALTER TABLE T_SRC_INVITESUPPLIER ADD (FISBIDPUBLISH CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_INVITESUPPLIER' AND KSQL_COL_NAME IN ('FISVIEPUBLISH')) 
 ALTER TABLE T_SRC_INVITESUPPLIER ADD (FISVIEPUBLISH CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_INVITESUPPLIER_TEMP' AND KSQL_COL_NAME IN ('FISAPTPUSH')) 
 ALTER TABLE T_SRC_INVITESUPPLIER_TEMP ADD (FISAPTPUSH CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_INVITESUPPLIER_TEMP' AND KSQL_COL_NAME IN ('FISAPTPUSH2')) 
 ALTER TABLE T_SRC_INVITESUPPLIER_TEMP ADD (FISAPTPUSH2 CHAR(1) DEFAULT '0' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_INVITESUPPLIER_TEMP' AND KSQL_COL_NAME IN ('FISBIDPUSH')) 
 ALTER TABLE T_SRC_INVITESUPPLIER_TEMP ADD (FISBIDPUSH CHAR(1) DEFAULT '0' NOT NULL );

IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_APTSCORERS') 
 CREATE TABLE T_SRC_APTSCORERS (
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_SRC_APTSCORERS2') 
 CREATE TABLE T_SRC_APTSCORERS2 (
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_SRC_TECSCORERS') 
 CREATE TABLE T_SRC_TECSCORERS (
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_SRC_BIZSCORERS') 
 CREATE TABLE T_SRC_BIZSCORERS (
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_SRC_ALLSCORERS') 
 CREATE TABLE T_SRC_ALLSCORERS (
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_SRC_BIDASSESSLOG') 
 CREATE TABLE T_SRC_BIDASSESSLOG (
FID BIGINT DEFAULT 0 NOT NULL,
FPARENTID VARCHAR(50) DEFAULT ' ' NOT NULL,
FORIGIN CHAR(1) DEFAULT ' ' NOT NULL,
FPENTITYKEY VARCHAR(50) DEFAULT ' ' NOT NULL,
FENTITYKEY VARCHAR(50) DEFAULT ' ' NOT NULL,
FSOURCETYPEID BIGINT DEFAULT 0 NOT NULL,
FSCHEMEID BIGINT DEFAULT 0 NOT NULL,
FRATIO_TEC DECIMAL(19,2) DEFAULT 0 NOT NULL,
FRATIO_BIZ DECIMAL(19,2) DEFAULT 0 NOT NULL,
FRATIO_OTH DECIMAL(19,2) DEFAULT 0 NOT NULL,
FRATIO_SYN DECIMAL(19,2) DEFAULT 0 NOT NULL,
FCURRENCYID BIGINT DEFAULT 0 NOT NULL,
FORGID BIGINT DEFAULT 0 NOT NULL,
FPROJECTID BIGINT DEFAULT 0 NOT NULL,
FCREATORID BIGINT DEFAULT 0 NOT NULL,
FCREATETIME DATETIME
);


IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_BIDASSESSLOGENTRY') 
 CREATE TABLE T_SRC_BIDASSESSLOGENTRY (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ INT DEFAULT 0 NOT NULL,
FBASETYPE CHAR(1) DEFAULT ' ' NOT NULL,
FPKGGROUPID BIGINT DEFAULT 0 NOT NULL,
FPACKAGEID BIGINT DEFAULT 0 NOT NULL,
FPURLISTID BIGINT DEFAULT 0 NOT NULL,
FRANK INT DEFAULT 0 NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERCODE NVARCHAR(100) DEFAULT ' ' NOT NULL,
FBIZAMOUNT DECIMAL(19,2) DEFAULT 0 NOT NULL,
FMAXVALUE DECIMAL(19,4) DEFAULT 0 NOT NULL,
FMINVALUE DECIMAL(19,4) DEFAULT 0 NOT NULL,
FAVGVALUE DECIMAL(19,4) DEFAULT 0 NOT NULL,
FBIZSCORE DECIMAL(19,4) DEFAULT 0 NOT NULL,
FTECSCORE DECIMAL(19,4) DEFAULT 0 NOT NULL,
FOTHSCORE DECIMAL(19,4) DEFAULT 0 NOT NULL,
FSUMSCORE DECIMAL(19,4) DEFAULT 0 NOT NULL,
FRESULT CHAR(1) DEFAULT ' ' NOT NULL,
FLOCAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FLOCTAXAMOUNT DECIMAL(23,10) DEFAULT 0 NOT NULL,
FPARENTID VARCHAR(50) DEFAULT ' ' NOT NULL,
FSUPPLIERTYPE VARCHAR(30) DEFAULT ' ' NOT NULL,
FINDEXTYPEID BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERIP VARCHAR(100) DEFAULT ' ' NOT NULL
);



/**End C:\PDM_UPGRADE\PDM1\SRC_table.sql **/
