<?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 Version20200323105459 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->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
$this->addSql('ALTER TABLE recipes ADD created_by_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE recipes ADD customer_owner_id INT DEFAULT NULL');
$this->addSql('ALTER TABLE recipes ADD short_name TEXT NOT NULL');
$this->addSql('ALTER TABLE recipes ADD fcc28 DOUBLE PRECISION DEFAULT \'0\' NOT NULL');
$this->addSql('ALTER TABLE recipes ADD dte0 DOUBLE PRECISION DEFAULT \'0\' NOT NULL');
$this->addSql('ALTER TABLE recipes ADD beta_add DOUBLE PRECISION DEFAULT \'0\' NOT NULL');
$this->addSql('ALTER TABLE recipes ADD theta DOUBLE PRECISION DEFAULT \'0\' NOT NULL');
$this->addSql('ALTER TABLE recipes ADD kappa DOUBLE PRECISION DEFAULT \'0\' NOT NULL');
$this->addSql('ALTER TABLE recipes ADD s DOUBLE PRECISION DEFAULT \'0\' NOT NULL');
$this->addSql('ALTER TABLE recipes ADD ts DOUBLE PRECISION DEFAULT \'0\' NOT NULL');
$this->addSql('ALTER TABLE recipes ADD ta DOUBLE PRECISION DEFAULT \'0\' NOT NULL');
$this->addSql('ALTER TABLE recipes ADD na DOUBLE PRECISION DEFAULT \'0\' NOT NULL');
$this->addSql('ALTER TABLE recipes ADD fa DOUBLE PRECISION DEFAULT \'0\' NOT NULL');
$this->addSql('COMMENT ON COLUMN recipes.short_name IS \'Recipe name.\'');
$this->addSql('COMMENT ON COLUMN recipes.fcc28 IS \'Compressive strength - fcc28 [MPa]\'');
$this->addSql('COMMENT ON COLUMN recipes.dte0 IS \'Dte0 [h]\'');
$this->addSql('COMMENT ON COLUMN recipes.beta_add IS \'Beta add.\'');
$this->addSql('COMMENT ON COLUMN recipes.theta IS \'Theta.\'');
$this->addSql('COMMENT ON COLUMN recipes.kappa IS \'Beta add.\'');
$this->addSql('COMMENT ON COLUMN recipes.s IS \'s [-]\'');
$this->addSql('COMMENT ON COLUMN recipes.ts IS \'tS [h]\'');
$this->addSql('COMMENT ON COLUMN recipes.ta IS \'tA [h].\'');
$this->addSql('COMMENT ON COLUMN recipes.na IS \'nA [h].\'');
$this->addSql('COMMENT ON COLUMN recipes.fa IS \'FA [MPa]\'');
$this->addSql('ALTER TABLE recipes ADD CONSTRAINT FK_A369E2B5B03A8386 FOREIGN KEY (created_by_id) REFERENCES users (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('ALTER TABLE recipes ADD CONSTRAINT FK_A369E2B552F922D6 FOREIGN KEY (customer_owner_id) REFERENCES customers (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
$this->addSql('CREATE INDEX IDX_A369E2B5B03A8386 ON recipes (created_by_id)');
$this->addSql('CREATE INDEX IDX_A369E2B552F922D6 ON recipes (customer_owner_id)');
$this->addSql('ALTER TABLE users ADD blocked_at TIMESTAMP(0) WITHOUT TIME ZONE DEFAULT NULL');
$this->addSql('COMMENT ON COLUMN users.blocked_at IS \'Blocked at.\'');
}
public function down(Schema $schema) : void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'postgresql', 'Migration can only be executed safely on \'postgresql\'.');
$this->addSql('CREATE SCHEMA public');
$this->addSql('ALTER TABLE recipes DROP CONSTRAINT FK_A369E2B5B03A8386');
$this->addSql('ALTER TABLE recipes DROP CONSTRAINT FK_A369E2B552F922D6');
$this->addSql('DROP INDEX IDX_A369E2B5B03A8386');
$this->addSql('DROP INDEX IDX_A369E2B552F922D6');
$this->addSql('ALTER TABLE recipes DROP created_by_id');
$this->addSql('ALTER TABLE recipes DROP customer_owner_id');
$this->addSql('ALTER TABLE recipes DROP short_name');
$this->addSql('ALTER TABLE recipes DROP fcc28');
$this->addSql('ALTER TABLE recipes DROP dte0');
$this->addSql('ALTER TABLE recipes DROP beta_add');
$this->addSql('ALTER TABLE recipes DROP theta');
$this->addSql('ALTER TABLE recipes DROP kappa');
$this->addSql('ALTER TABLE recipes DROP s');
$this->addSql('ALTER TABLE recipes DROP ts');
$this->addSql('ALTER TABLE recipes DROP ta');
$this->addSql('ALTER TABLE recipes DROP na');
$this->addSql('ALTER TABLE recipes DROP fa');
$this->addSql('ALTER TABLE users DROP blocked_at');
}
}