/**Begin C:\PDM_UPGRADE\PDM1\SRC_table.sql **/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_APPLY' AND KSQL_COL_NAME IN ('FSOURCETYPEID')) 
 ALTER TABLE T_SRC_APPLY ADD (FSOURCETYPEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_APPLY' AND KSQL_COL_NAME IN ('FSRCTYPEID')) 
 ALTER TABLE T_SRC_APPLY ADD (FSRCTYPEID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_PROJECT_A' AND KSQL_COL_NAME IN ('FSRCAPPLYID')) 
 ALTER TABLE T_SRC_PROJECT_A ADD (FSRCAPPLYID BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_SRC_MATERIALENDENTRY' AND KSQL_COL_NAME IN ('FCOUNT')) 
 ALTER TABLE T_SRC_MATERIALENDENTRY ADD (FCOUNT INT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_SRC_APPLYSUPPLIER') 
 CREATE TABLE T_SRC_APPLYSUPPLIER (
FID BIGINT DEFAULT 0 NOT NULL,
FENTRYID BIGINT DEFAULT 0 NOT NULL,
FSEQ BIGINT DEFAULT 0 NOT NULL,
FSUPPLIERID BIGINT DEFAULT 0 NOT NULL,
FNOTE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FPACKAGEID BIGINT DEFAULT 0 NOT NULL,
FSUPNAME NVARCHAR(255) DEFAULT ' ' NOT NULL,
FLINKMAN NVARCHAR(50) DEFAULT ' ' NOT NULL,
FPHONE NVARCHAR(50) DEFAULT ' ' NOT NULL,
FADDRESS NVARCHAR(100) DEFAULT ' ' NOT NULL,
FDUTY NVARCHAR(50) DEFAULT ' ' NOT NULL,
FEMAIL NVARCHAR(50) DEFAULT ' ' NOT NULL,
FISPURAGENT CHAR(1) DEFAULT '0' NOT NULL,
FSOCIETYCREDITCODE NVARCHAR(255) DEFAULT ' ' NOT NULL,
FSUPPLIERTYPE VARCHAR(50) DEFAULT ' ' NOT NULL,
FISFEEAGENT CHAR(1) DEFAULT '0' NOT NULL
);



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