<?php

return [
    'key' => '2026_03_22_000003_backfill_default_team_license',
    'title' => 'Standardlizenz Team für vorhandene Mandanten setzen',
    'description' => 'Alle bestehenden Mandanten erhalten standardmäßig die Team-Lizenz.',
    'statements' => [
        <<<'SQL'
INSERT INTO tenant_licenses (id, tenant_id, license_plan_id, status, starts_at, ends_at, created_at, updated_at)
SELECT
    CONCAT('tenant-license-', t.id),
    t.id,
    '0f6e004d-ec4c-4f12-8f91-fdf795b80a02',
    'active',
    NOW(),
    NULL,
    NOW(),
    NOW()
FROM tenants t
WHERE NOT EXISTS (
    SELECT 1 FROM tenant_licenses tl WHERE tl.tenant_id = t.id
);
SQL,
    ],
];
