/**Begin D:\PDMTOOLS\PDM_UPGRADE_1.3\PDM_UPGRADE\PDM1\TPO_constraint.sql **/

 EXEC P_ALTERPK 'PK_TPO_DECLARE_DETAIL_TSD', 'T_TPO_DECLARE_DETAIL_TSD', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_DECLARE_DETAIL_TSD_CELLNUM') CREATE UNIQUE INDEX IDX_DECLARE_DETAIL_TSD_CELLNUM ON T_TPO_DECLARE_DETAIL_TSD ( FCELLNUMBER ,FENTRYID );


 EXEC P_ALTERPK 'PK_TPO_DECLARE_MAIN_TSD', 'T_TPO_DECLARE_MAIN_TSD', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_DECL_MAIN_TSD_ORGID_QZME') CREATE UNIQUE INDEX IDX_DECL_MAIN_TSD_ORGID_QZME ON T_TPO_DECLARE_MAIN_TSD ( FORGID ,FSKSSQQ ,FSKSSQZ ,FTAXSYSTEM ,FACCOUNTSETTYPE );

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_DECLARE_MAIN_TSD_FBILLNO') CREATE UNIQUE INDEX IDX_DECLARE_MAIN_TSD_FBILLNO ON T_TPO_DECLARE_MAIN_TSD ( FBILLNO );


/**End D:\PDMTOOLS\PDM_UPGRADE_1.3\PDM_UPGRADE\PDM1\TPO_constraint.sql **/
