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

 EXEC P_ALTERPK 'PK_PRIVACY_BLACKFIELDINFO_L', 'T_PRIVACY_BLACKFIELDINFO_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_PRIVACY_BLACKFIELDINFO_L' AND KSQL_INDNAME = 'IDX_PRIVACY_BLACKFIELD_L_FID') CREATE UNIQUE INDEX IDX_PRIVACY_BLACKFIELD_L_FID ON T_PRIVACY_BLACKFIELDINFO_L ( FENTRYID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_PRIVACY_DATA_FIELD_TPL_L', 'T_PRIVACY_DATA_FIELD_TPL_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_PRIVACY_DATA_FIELD_TPL_L' AND KSQL_INDNAME = 'IDX_PRIVACY_DATAFIELD_T_L_FID') CREATE UNIQUE INDEX IDX_PRIVACY_DATAFIELD_T_L_FID ON T_PRIVACY_DATA_FIELD_TPL_L ( FENTRYID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_PRIVACY_DESEN_TPL_L', 'T_PRIVACY_DESEN_TPL_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_PRIVACY_DESEN_TPL_L' AND KSQL_INDNAME = 'IDX_PRIVACY_DESEN_TPL_L_FID') CREATE UNIQUE INDEX IDX_PRIVACY_DESEN_TPL_L_FID ON T_PRIVACY_DESEN_TPL_L ( FENTRYID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_PRIVACY_ENCRYPT_TPL_L', 'T_PRIVACY_ENCRYPT_TPL_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_PRIVACY_ENCRYPT_TPL_L' AND KSQL_INDNAME = 'IDX_PRIVACY_ENCRYPT_TPL_L_FID') CREATE UNIQUE INDEX IDX_PRIVACY_ENCRYPT_TPL_L_FID ON T_PRIVACY_ENCRYPT_TPL_L ( FENTRYID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_PRIVACY_DATA_TAG_FIELDS_L', 'T_PRIVACY_DATA_TAG_FIELDS_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_PRIVACY_DATA_TAG_FIELDS_L' AND KSQL_INDNAME = 'IDX_PRIVACY_DTAGFIELDS_L_FID') CREATE UNIQUE INDEX IDX_PRIVACY_DTAGFIELDS_L_FID ON T_PRIVACY_DATA_TAG_FIELDS_L ( FENTRYID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_PRIVACY_DESEN_AUTHORITY_L', 'T_PRIVACY_DESEN_AUTHORITY_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_PRIVACY_DESEN_AUTHORITY_L' AND KSQL_INDNAME = 'IDX_PRIVACY_DESENAUTH_L_FID') CREATE UNIQUE INDEX IDX_PRIVACY_DESENAUTH_L_FID ON T_PRIVACY_DESEN_AUTHORITY_L ( FENTRYID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_PRIVACY_SCHEME_DESEN_L', 'T_PRIVACY_SCHEME_DESEN_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_PRIVACY_SCHEME_DESEN_L' AND KSQL_INDNAME = 'IDX_PRIVACY_SEME_DES_L_FID') CREATE UNIQUE INDEX IDX_PRIVACY_SEME_DES_L_FID ON T_PRIVACY_SCHEME_DESEN_L ( FENTRYID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_PRIVACY_SCHEME_ENCRYPT_L', 'T_PRIVACY_SCHEME_ENCRYPT_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_PRIVACY_SCHEME_ENCRYPT_L' AND KSQL_INDNAME = 'IDX_PRIVACY_SEME_ENC_L_FID') CREATE UNIQUE INDEX IDX_PRIVACY_SEME_ENC_L_FID ON T_PRIVACY_SCHEME_ENCRYPT_L ( FENTRYID ,FLOCALEID );


 EXEC P_ALTERPK 'PK_PRIVACY_TASK_L', 'T_PRIVACY_TASK_L', 'FPKID', '1';

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



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