pluck('column_name')->all(); expect($cols)->toContain('id', 'first_seen_at', 'last_seen_at', 'channel', 'utm_source', 'referrer', 'landing_path', 'device', 'user_agent', 'ip', 'city', 'asn_org', 'is_datacenter', 'is_human', 'tenant_id', 'user_id'); }); test('site_events партиционирована по месяцу', function () { $parted = DB::selectOne(" SELECT c.relkind FROM pg_class c WHERE c.relname = 'site_events' "); expect($parted->relkind)->toBe('p'); // p = partitioned table }); test('клиентская роль crm_app_user не имеет доступа к site_visitors', function () { $grants = DB::select(" SELECT grantee FROM information_schema.role_table_grants WHERE table_name = 'site_visitors' "); $grantees = collect($grants)->pluck('grantee')->all(); expect($grantees)->not->toContain('crm_app_user'); })->skip(fn () => DB::selectOne("SELECT 1 FROM pg_roles WHERE rolname='crm_app_user'") === null, 'роли crm_app_user нет на dev');