/**Begin D:\work\kuaijishijian\pdm\PDM_UPGRADE\PDM1\AI_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_AI_NEWBUILDREPORTHEAD', 'T_AI_NEWBUILDREPORTHEAD', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_AI_NEWBUILDREPORTHEAD' AND KSQL_INDNAME = 'IDX_AI_NEWBUILDREPORT') CREATE INDEX IDX_AI_NEWBUILDREPORT ON T_AI_NEWBUILDREPORTHEAD ( FPERIODID ,FBOOKID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_AI_NEWBUILDREPORTHEAD' AND KSQL_INDNAME = 'IDX_AI_NEWBUILDREPORT_GV') CREATE INDEX IDX_AI_NEWBUILDREPORT_GV ON T_AI_NEWBUILDREPORTHEAD ( FGLVOUCHER );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_AI_NEWBUILDREPORTHEAD' AND KSQL_INDNAME = 'IDX_AI_NEWBUILDREPORT_TS') CREATE INDEX IDX_AI_NEWBUILDREPORT_TS ON T_AI_NEWBUILDREPORTHEAD ( FOPDATE ,FSOURCEBILL );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_AI_NEWBUILDREPORTHEAD' AND KSQL_INDNAME = 'IDX_AI_NEWBUILDREPORT_S') CREATE INDEX IDX_AI_NEWBUILDREPORT_S ON T_AI_NEWBUILDREPORTHEAD ( FSOURCEBILLNO ,FSOURCEBILLID );


 EXEC P_ALTERPK 'PK_T_AI_NEWBUILDREPORTENTRY', 'T_AI_NEWBUILDREPORTENTRY', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_AI_NEWBUILDREPORTENTRY' AND KSQL_INDNAME = 'IDX_AI_NEWBUILDREPORTENTRY') CREATE INDEX IDX_AI_NEWBUILDREPORTENTRY ON T_AI_NEWBUILDREPORTENTRY ( FCHECKITEM ,FERRLEVEL ,FBUILDREPORTHEADID );



/**End D:\work\kuaijishijian\pdm\PDM_UPGRADE\PDM1\AI_constraint.sql **/
