<?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 Version20220824070957 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('DROP SEQUENCE shift_period_id_seq CASCADE');
$this->addSql('CREATE SEQUENCE "shift_periods_id_seq" INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE TABLE "shift_periods" (id INT NOT NULL, user_id INT DEFAULT NULL, type VARCHAR(50) NOT NULL, extra VARCHAR(50) DEFAULT NULL, day INT NOT NULL, month INT NOT NULL, year INT NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX IDX_A46A4DBA76ED395 ON "shift_periods" (user_id)');
$this->addSql('ALTER TABLE "shift_periods" ADD CONSTRAINT FK_A46A4DBA76ED395 FOREIGN KEY (user_id) REFERENCES "users" (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('DROP TABLE shift_period');
}
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 "shift_periods_id_seq" CASCADE');
$this->addSql('CREATE SEQUENCE shift_period_id_seq INCREMENT BY 1 MINVALUE 1 START 1');
$this->addSql('CREATE TABLE shift_period (id INT NOT NULL, user_id INT DEFAULT NULL, type VARCHAR(50) NOT NULL, extra VARCHAR(50) DEFAULT NULL, day INT NOT NULL, month INT NOT NULL, year INT NOT NULL, PRIMARY KEY(id))');
$this->addSql('CREATE INDEX idx_49608cdba76ed395 ON shift_period (user_id)');
$this->addSql('ALTER TABLE shift_period ADD CONSTRAINT fk_49608cdba76ed395 FOREIGN KEY (user_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('DROP TABLE "shift_periods"');
}
}