/**Begin D:\pdm\PDM_UPGRADE_1.1\PDM_UPGRADE\pdm1\SIM_constraint.sql **/
 EXEC P_ALTERPK 'PK_SIM_GIFT_RECEIPT', 'T_SIM_GIFT_RECEIPT', 'FID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SIM_GIFT_RECEIPT_BILLNO') CREATE  CLUSTERED INDEX IDX_SIM_GIFT_RECEIPT_BILLNO ON T_SIM_GIFT_RECEIPT ( FBILLNO );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SIM_GIFT_RECEIPT_ORG') CREATE INDEX IDX_SIM_GIFT_RECEIPT_ORG ON T_SIM_GIFT_RECEIPT ( FORGID );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SIM_GIFT_RECEIPT_CREATE') CREATE INDEX IDX_SIM_GIFT_RECEIPT_CREATE ON T_SIM_GIFT_RECEIPT ( FCREATETIME );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SIM_GIFT_RECEIPT_EXPIRE') CREATE INDEX IDX_SIM_GIFT_RECEIPT_EXPIRE ON T_SIM_GIFT_RECEIPT ( FEXPIRINGDATE );


 EXEC P_ALTERPK 'PK_SIM_GIFT_RECEIPT_ITEM', 'T_SIM_GIFT_RECEIPT_ITEM', 'FENTRYID', '0';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_SIM_GIFT_RECEIPT_ID') CREATE  CLUSTERED INDEX IDX_SIM_GIFT_RECEIPT_ID ON T_SIM_GIFT_RECEIPT_ITEM ( FID );



/**End D:\pdm\PDM_UPGRADE_1.1\PDM_UPGRADE\pdm1\SIM_constraint.sql **/
