/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SYS_constraint.sql **/

 EXEC P_ALTERPK 'PK_T_PRIVACY_TRANSCHANNEL', 'T_PRIVACY_TRANSCHANNEL', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_PRIVACY_TRANSCHANNEL' AND KSQL_INDNAME = 'IDX_PRIVACY_CHANNEL_NUM') CREATE INDEX IDX_PRIVACY_CHANNEL_NUM ON T_PRIVACY_TRANSCHANNEL ( FNUMBER );


 EXEC P_ALTERPK 'PK_T_PRIVACY_TRANSDATATAG', 'T_PRIVACY_TRANSDATATAG', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_PRIVACY_TRANSDATATAG' AND KSQL_INDNAME = 'IDX_PRIVACY_TRANSTAG_NUM') CREATE INDEX IDX_PRIVACY_TRANSTAG_NUM ON T_PRIVACY_TRANSDATATAG ( FNUMBER );


 EXEC P_ALTERPK 'PK_T_PRIVACY_TRANSDATATAG_L', 'T_PRIVACY_TRANSDATATAG_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_PRIVACY_TRANSDATATAG_L' AND KSQL_INDNAME = 'IDX_PRIVACY_TRANSTAG_L_FID') CREATE UNIQUE INDEX IDX_PRIVACY_TRANSTAG_L_FID ON T_PRIVACY_TRANSDATATAG_L ( FID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_T_PRIVACY_TRANSRULES', 'T_PRIVACY_TRANSRULES', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_PRIVACY_TRANSRULES' AND KSQL_INDNAME = 'IDX_PRIVACY_TRANSRULES_NUM') CREATE INDEX IDX_PRIVACY_TRANSRULES_NUM ON T_PRIVACY_TRANSRULES ( FNUMBER );



/**End E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SYS_constraint.sql **/
