/**Begin D:\work\kuaijishijian\pdm\PDM_UPGRADE_1.4\PDM_UPGRADE\PDM1\AI_table.sql **/
EXEC p_AlterColumn 'T_FAH_DYNEXTFLD_VALSET', 'FGETVALUETYPE', 'VARCHAR(2)', 'NOT NULL', '1111', ''' ''';

IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FAH_DYNEXTFLD_VALSET' AND KSQL_COL_NAME ='FOUTPUTDATATYPE')
ALTER TABLE T_FAH_DYNEXTFLD_VALSET ADD (FOUTPUTDATATYPE VARCHAR(2) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FAH_DYNEXTFLD_VALSET' AND KSQL_COL_NAME ='FREFBASEPROP')
ALTER TABLE T_FAH_DYNEXTFLD_VALSET ADD (FREFBASEPROP VARCHAR(36) DEFAULT ' ' NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_FAH_DYNEXTFLD_VALSET' AND KSQL_COL_NAME ='FASSISTPROP')
ALTER TABLE T_FAH_DYNEXTFLD_VALSET ADD (FASSISTPROP BIGINT DEFAULT 0 NOT NULL );
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_FAH_REFERENCE_FIELD')
CREATE TABLE T_FAH_REFERENCE_FIELD (
                                       FID BIGINT DEFAULT 0 NOT NULL,
                                       FSEQ INT DEFAULT 0 NOT NULL,
                                       FNAME NVARCHAR(50) DEFAULT ' ' NOT NULL,
                                       FEVTLINETYPEID BIGINT DEFAULT 0 NOT NULL,
                                       FEVTLINEID BIGINT DEFAULT 0 NOT NULL,
                                       FEVTRULEID BIGINT DEFAULT 0 NOT NULL,
                                       FBILLTYPE VARCHAR(36) DEFAULT ' ' NOT NULL,
                                       FREFFIELDCFGID BIGINT DEFAULT 0 NOT NULL
);


EXEC p_AlterColumn 'T_FAH_DYNEXTFLD_MAPEN', 'FGETVALUETYPE', 'VARCHAR(2)', 'NOT NULL', '1111', ''' ''';


/**End D:\work\kuaijishijian\pdm\PDM_UPGRADE_1.4\PDM_UPGRADE\PDM1\AI_table.sql **/
