<?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 Version20210625081116 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 news (id INT AUTO_INCREMENT NOT NULL, country_id INT NOT NULL, language VARCHAR(2) NOT NULL, title VARCHAR(255) NOT NULL, type INT NOT NULL, date DATETIME DEFAULT NULL, author VARCHAR(255) NOT NULL, is_live TINYINT(1) DEFAULT NULL, source VARCHAR(255) NOT NULL, text LONGTEXT NOT NULL, date_created DATETIME DEFAULT NULL, date_updated DATETIME DEFAULT NULL, image_name VARCHAR(255) DEFAULT NULL, INDEX IDX_1DD39950F92F3E70 (country_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE news ADD CONSTRAINT FK_1DD39950F92F3E70 FOREIGN KEY (country_id) REFERENCES countries (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('DROP TABLE news');
}
}