Files
portal/app/tests/Unit/Services/MonthlyPartitionManagerTest.php
T
Дмитрий 662be183db feat(schema): project_routing_snapshots partitioned table + MonthlyPartitionManager entry (Task 2.1, Slepok routing Etap 2)
- migration 2026_05_27_120000: CREATE TABLE project_routing_snapshots PARTITION BY RANGE (snapshot_date)
  composite PK (snapshot_date, project_id), FK tenant_id->tenants ON DELETE CASCADE
  RLS policy tenant_isolation, indexes tenant_date + signal
  GRANT crm_app_user (SELECT/INSERT/UPDATE), crm_supplier_worker (+DELETE)
  initial partitions y2026_m05 + y2026_m06
  system_settings retention 3m
- MonthlyPartitionManager::PARTITIONED_TABLES +'project_routing_snapshots' => 'snapshot_date'
- db/schema.sql -> v8.39
- tests: ProjectRoutingSnapshotsTableTest (3) + Unit/MonthlyPartitionManagerTest (1) GREEN

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
2026-05-27 07:56:08 +03:00

16 lines
583 B
PHP
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<?php
declare(strict_types=1);
use App\Services\MonthlyPartitionManager;
// Unit test: verifies PARTITIONED_TABLES constant only — no DB.
// Added for TDD: project_routing_snapshots (snapshot_date key, Этап 2, 27.05.2026).
test('PARTITIONED_TABLES содержит project_routing_snapshots с ключом snapshot_date', function (): void {
expect(MonthlyPartitionManager::PARTITIONED_TABLES)
->toHaveKey('project_routing_snapshots')
->and(MonthlyPartitionManager::PARTITIONED_TABLES['project_routing_snapshots'])
->toBe('snapshot_date');
});