/**Begin E:\NextERP_PDM\PDM_UPGRADE\PDMS\branch_lastest\pdm\SYS_constraint.sql **/
 EXEC P_ALTERPK 'PK_T_BAS_LIGHTLAYOUT_L', 'T_BAS_LIGHTLAYOUT_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BAS_LIGHTLAYOUTBILL_L', 'T_BAS_LIGHTLAYOUTBILL_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BAS_LIGHTLAYOUTLIST_L', 'T_BAS_LIGHTLAYOUTLIST_L', 'FPKID', '1';

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


 EXEC P_ALTERPK 'PK_T_BAS_LIGHTLAYOUT', 'T_BAS_LIGHTLAYOUT', 'FID', '1';

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


 EXEC P_ALTERPK 'PK_T_BAS_LIGHTLAYOUTBILL', 'T_BAS_LIGHTLAYOUTBILL', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_BAS_LIGHTLAYOUTBILL' AND KSQL_INDNAME = 'IX_T_BAS_LIGHTLAYOUTBILL_ID') CREATE INDEX IX_T_BAS_LIGHTLAYOUTBILL_ID ON T_BAS_LIGHTLAYOUTBILL ( FID );


 EXEC P_ALTERPK 'PK_T_BAS_LIGHTLAYOUTLIST', 'T_BAS_LIGHTLAYOUTLIST', 'FENTRYID', '1';

 IF NOT EXISTS (SELECT 1 FROM KSQL_INDEXES WHERE KSQL_TABNAME = 'T_BAS_LIGHTLAYOUTLIST' AND KSQL_INDNAME = 'IX_T_BAS_LIGHTLAYOUTLIST_ID') CREATE INDEX IX_T_BAS_LIGHTLAYOUTLIST_ID ON T_BAS_LIGHTLAYOUTLIST ( FID );



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