mirror of
https://github.com/Tria-plc/edr-platform.git
synced 2026-08-29 21:08:12 +00:00
feat: add pagination to schedule history and consolidation approvals
- Implemented pagination in ScheduleHistoryPanel to manage large history entries. - Updated API to support pagination parameters for schedule history. - Enhanced ConsolidationApprovalsPage with tabbed navigation and pagination for approval rows. - Introduced new types for paginated responses in bookings and train scheduling services. - Added a database migration to create an index on wagon_booking_allocations for performance improvements.
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
/**
|
||||
* Every slot → allocations lookup (allocator, journey load/unload, settle,
|
||||
* per-leg weight guard) filters wagon_booking_allocations by
|
||||
* train_set_wagon_id, which had no index — only booking_id and the pkey.
|
||||
* Sequential scans grow with every allocation ever written.
|
||||
*/
|
||||
export class WagonAllocationSlotIndex3680000000000 implements MigrationInterface {
|
||||
name = 'WagonAllocationSlotIndex3680000000000';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`
|
||||
CREATE INDEX IF NOT EXISTS idx_wagon_booking_allocations_slot
|
||||
ON freight.wagon_booking_allocations (train_set_wagon_id)
|
||||
`);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(`
|
||||
DROP INDEX IF EXISTS freight.idx_wagon_booking_allocations_slot
|
||||
`);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user