<?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 Version20240426221528 extends AbstractMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE TABLE web_service (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE web_service_log (id INT AUTO_INCREMENT NOT NULL, web_service_id INT NOT NULL, called_by_id INT NOT NULL, called_at DATETIME NOT NULL COMMENT \'(DC2Type:datetime_immutable)\', INDEX IDX_A45837236C3C13EA (web_service_id), INDEX IDX_A4583723B2200C33 (called_by_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE web_service_log ADD CONSTRAINT FK_A45837236C3C13EA FOREIGN KEY (web_service_id) REFERENCES web_service (id)');
$this->addSql('ALTER TABLE web_service_log ADD CONSTRAINT FK_A4583723B2200C33 FOREIGN KEY (called_by_id) REFERENCES user (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE web_service_log DROP FOREIGN KEY FK_A45837236C3C13EA');
$this->addSql('ALTER TABLE web_service_log DROP FOREIGN KEY FK_A4583723B2200C33');
$this->addSql('DROP TABLE web_service');
$this->addSql('DROP TABLE web_service_log');
}
}