
IF NOT EXISTS (SELECT 1 FROM KSQL_USERCOLUMNS WHERE KSQL_COL_TABNAME = 'T_EB_APPROVEBILL' AND KSQL_COL_NAME IN ('FAPPROVETYPEVERSION'))
ALTER TABLE T_EB_APPROVEBILL ADD (FAPPROVETYPEVERSION BIGINT NOT NULL DEFAULT 0);

/*==============================================================*/
/* Table: T_EB_APPROVEDESC          提交审核备注表                */
/*==============================================================*/
IF NOT EXISTS (SELECT 1 FROM KSQL_USERTABLES WHERE KSQL_TABNAME = 'T_EB_APPROVEDESC')
CREATE TABLE T_EB_APPROVEDESC (
   FID                  BIGINT               NOT NULL DEFAULT 0,
   FPROCESSID           BIGINT               NOT NULL DEFAULT 0,
   FDESC                NVARCHAR(2000)       NOT NULL DEFAULT ' '
);

 EXEC P_ALTERPK 'PK_EB_APPROVEDESC', 'T_EB_APPROVEDESC', 'FID', '1';

/*==============================================================*/
/* Index: IDX_EB_APPROVEDESC                                    */
/*==============================================================*/
 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_EB_APPROVEDESC')
CREATE INDEX IDX_EB_APPROVEDESC ON T_EB_APPROVEDESC ( FPROCESSID );
