SuperSeller3000/migrations/Version20260514054123.php
Simon Kuehn 2cfc5e8f17 feat: add console commands, remaining migrations and config wiring
Console commands: CreateUser (interactive), BackupCommand, RotateLogsCommand.
Migrations 20260514: initial schema for app/logs schemas.
Config: register new bundles, Doctrine schema filter, Kernel micro-kernel
adjustments, deleted unused api.yaml route file and www.conf override.
Application service and API controller updates for the full article lifecycle.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-05-17 22:44:11 +00:00

39 lines
1.7 KiB
PHP

<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20260514054123 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
$this->addSql('CREATE SCHEMA IF NOT EXISTS logs');
$this->addSql('CREATE SCHEMA IF NOT EXISTS logs_archive');
$this->addSql('CREATE SEQUENCE logs.log_entries_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE TABLE logs.log_entries (id BIGINT NOT NULL, channel VARCHAR(50) NOT NULL, level INT NOT NULL, level_name VARCHAR(50) NOT NULL, message TEXT NOT NULL, context JSON NOT NULL, extra JSON NOT NULL, logged_at TIMESTAMP(0) WITHOUT TIME ZONE NOT NULL, PRIMARY KEY(id))');
$this->addSql('COMMENT ON COLUMN logs.log_entries.logged_at IS \'(DC2Type:datetime_immutable)\'');
$this->addSql('CREATE INDEX idx_log_entries_channel ON logs.log_entries (channel)');
$this->addSql('CREATE INDEX idx_log_entries_level ON logs.log_entries (level)');
$this->addSql('CREATE INDEX idx_log_entries_logged_at ON logs.log_entries (logged_at)');
$this->addSql('ALTER SEQUENCE logs.log_entries_id_seq OWNED BY logs.log_entries.id');
$this->addSql('ALTER TABLE logs.log_entries ALTER id SET DEFAULT nextval(\'logs.log_entries_id_seq\')');
}
public function down(Schema $schema): void
{
$this->addSql('DROP TABLE logs.log_entries');
$this->addSql('DROP SEQUENCE logs.log_entries_id_seq CASCADE');
}
}