<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Add StdConfig entry for page audit content types filter
*/
final class Version20251103191211 extends AbstractMigration
{
public function getDescription(): string
{
return 'Add configuration entry to control which content types should be audited for page edit tracking';
}
public function up(Schema $schema): void
{
// Insert config entry for page audit content types
$this->addSql("
INSERT INTO std_config (
machine_name,
label,
value,
description_machine_name,
details_machine_name,
parent_name,
created_date,
updated_date,
created_by,
updated_by,
is_hidden,
language_code,
content,
roles,
variable_type,
order_value
) VALUES (
'page_audit_content_types',
'Page Audit - Content Types',
NULL,
'page_audit_content_types_description',
'page_audit_content_types_details',
'System',
NOW(),
NOW(),
1,
1,
0,
'',
'{\"query\": \"select id, name as label from std_content_types order by name\"}',
'[\"ROLE_SUPER_ADMIN\"]',
'SELECT_MULTIPLE',
99
)
");
}
public function down(Schema $schema): void
{
// Remove the config entry
$this->addSql("DELETE FROM std_config WHERE machine_name = 'page_audit_content_types'");
}
}