41 lines
874 B
PHP
41 lines
874 B
PHP
<?php
|
|
|
|
declare(strict_types=1);
|
|
|
|
namespace Template\Migrations\Log;
|
|
|
|
use Doctrine\DBAL\Schema\Schema;
|
|
use Doctrine\Migrations\AbstractMigration;
|
|
|
|
/**
|
|
* Auto-generated Migration: Please modify to your needs!
|
|
*/
|
|
final class Version20230922150649 extends AbstractMigration
|
|
{
|
|
public function getDescription(): string
|
|
{
|
|
return "Create Table 'log'";
|
|
}
|
|
|
|
public function up(Schema $schema): void
|
|
{
|
|
$query = 'CREATE TABLE log (
|
|
id BINARY(16) NOT NULL,
|
|
message TEXT NOT NULL,
|
|
context JSON DEFAULT NULL,
|
|
level INT NOT NULL ,
|
|
level_name VARCHAR(50) NOT NULL,
|
|
extra JSON DEFAULT NULL,
|
|
created_at datetime NOT NULL,
|
|
PRIMARY KEY (id)
|
|
)';
|
|
|
|
$this->addSql($query);
|
|
}
|
|
|
|
public function down(Schema $schema): void
|
|
{
|
|
$this->addSql('DROP TABLE log');
|
|
}
|
|
}
|