<?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 Version20220814090517 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 banner (id INT AUTO_INCREMENT NOT NULL, immagine VARCHAR(255) NOT NULL, posizione VARCHAR(10) DEFAULT NULL, updated_at DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE gallery (id INT AUTO_INCREMENT NOT NULL, immagine VARCHAR(255) DEFAULT NULL, video VARCHAR(255) DEFAULT NULL, ordine INT DEFAULT NULL, updated_at DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE nuptials (id INT AUTO_INCREMENT NOT NULL, titolo VARCHAR(255) DEFAULT NULL, copertina VARCHAR(255) DEFAULT NULL, descrizione LONGTEXT DEFAULT NULL, updated_at DATETIME NOT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE nuptials_gallery (id INT AUTO_INCREMENT NOT NULL, nuptial_id INT NOT NULL, immagine VARCHAR(255) DEFAULT NULL, video VARCHAR(255) DEFAULT NULL, ordine INT DEFAULT NULL, updated_at DATETIME NOT NULL, INDEX IDX_2094B3A841BEEB71 (nuptial_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE `user` (id INT AUTO_INCREMENT NOT NULL, email VARCHAR(180) NOT NULL, roles JSON NOT NULL, password VARCHAR(255) NOT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C74 (email), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('CREATE TABLE messenger_messages (id BIGINT AUTO_INCREMENT NOT NULL, body LONGTEXT NOT NULL, headers LONGTEXT NOT NULL, queue_name VARCHAR(255) NOT NULL, created_at DATETIME NOT NULL, available_at DATETIME NOT NULL, delivered_at DATETIME DEFAULT NULL, INDEX IDX_75EA56E016BA31DB (delivered_at), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
$this->addSql('ALTER TABLE nuptials_gallery ADD CONSTRAINT FK_2094B3A841BEEB71 FOREIGN KEY (nuptial_id) REFERENCES nuptials (id)');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('ALTER TABLE nuptials_gallery DROP FOREIGN KEY FK_2094B3A841BEEB71');
$this->addSql('DROP TABLE banner');
$this->addSql('DROP TABLE gallery');
$this->addSql('DROP TABLE nuptials');
$this->addSql('DROP TABLE nuptials_gallery');
$this->addSql('DROP TABLE `user`');
$this->addSql('DROP TABLE messenger_messages');
}
}