/**Begin D:\PDM_UPGRADE\pdm_new\BOS_constraint.sql **/
EXEC P_ALTERPK 'PK_T_PERM_ROLEFIELDSCHEME', 'T_PERM_ROLEFIELDSCHEME', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PRFS_ROLEAPPENT') CREATE INDEX IDX_PRFS_ROLEAPPENT ON T_PERM_ROLEFIELDSCHEME ( FROLEID ,FAPPID ,FENTNUM );


EXEC P_ALTERPK 'PK_T_PERM_USERFIELDSCHEME', 'T_PERM_USERFIELDSCHEME', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PUFS_USERAPPENT') CREATE INDEX IDX_PUFS_USERAPPENT ON T_PERM_USERFIELDSCHEME ( FUSERID ,FAPPID ,FENTNUM );


EXEC P_ALTERPK 'PK_T_PERM_FIELDSCHEME', 'T_PERM_FIELDSCHEME', 'FID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PERM_FIELDSCHEME_NUM') CREATE UNIQUE INDEX IDX_PERM_FIELDSCHEME_NUM ON T_PERM_FIELDSCHEME ( FNUMBER );


EXEC P_ALTERPK 'PK_T_PERM_FIELDSCHEME_L', 'T_PERM_FIELDSCHEME_L', 'FPKID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_PERM_FIELDSCHEME_L') CREATE INDEX IDX_PERM_FIELDSCHEME_L ON T_PERM_FIELDSCHEME_L ( FID ,FLOCALEID );


EXEC P_ALTERPK 'PK_PERM_FIELDSCHEMED', 'T_PERM_FIELDSCHEMED', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_INDNAME = 'IDX_FPSD_FIELNAME') CREATE INDEX IDX_FPSD_FIELNAME ON T_PERM_FIELDSCHEMED ( FFIELDNAME );



/**End D:\PDM_UPGRADE\pdm_new\BOS_constraint.sql **/
