<?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 Version20220707110054 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 SEQUENCE schedule_queue_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE TABLE schedule_queue (id INT NOT NULL, owner_id INT NOT NULL, printer_id INT NOT NULL, printer_user_id INT NOT NULL, image VARCHAR(255) NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_83A4BF3F7E3C61F9 ON schedule_queue (owner_id)');
$this->addSql('CREATE INDEX IDX_83A4BF3F46EC494A ON schedule_queue (printer_id)');
$this->addSql('CREATE INDEX IDX_83A4BF3F83EF2994 ON schedule_queue (printer_user_id)');
$this->addSql('ALTER TABLE schedule_queue ADD CONSTRAINT FK_83A4BF3F7E3C61F9 FOREIGN KEY (owner_id) REFERENCES "user" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE schedule_queue ADD CONSTRAINT FK_83A4BF3F46EC494A FOREIGN KEY (printer_id) REFERENCES printer (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE schedule_queue ADD CONSTRAINT FK_83A4BF3F83EF2994 FOREIGN KEY (printer_user_id) REFERENCES printer_user (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
}
public function down(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->addSql('CREATE SCHEMA public');
$this->addSql('DROP SEQUENCE schedule_queue_id_seq CASCADE');
$this->addSql('DROP TABLE schedule_queue');
}
}