migrations/Version20191119042924.php line 1

Open in your IDE?
  1. <?php
  2. declare(strict_types=1);
  3. namespace DoctrineMigrations;
  4. use Doctrine\DBAL\Schema\Schema;
  5. use Doctrine\Migrations\AbstractMigration;
  6. /**
  7.  * Auto-generated Migration: Please modify to your needs!
  8.  */
  9. final class Version20191119042924 extends AbstractMigration
  10. {
  11.     public function getDescription() : string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema) : void
  16.     {
  17.         // this up() migration is auto-generated, please modify it to your needs
  18.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  19.         $this->addSql('DROP TABLE client_disable');
  20.     }
  21.     public function down(Schema $schema) : void
  22.     {
  23.         // this down() migration is auto-generated, please modify it to your needs
  24.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  25.         $this->addSql('CREATE TABLE client_disable (id INT AUTO_INCREMENT NOT NULL, total NUMERIC(10, 2) DEFAULT NULL, comment TEXT CHARACTER SET utf8 NOT NULL COLLATE `utf8_unicode_ci`, createdAt DATETIME NOT NULL, updatedAt DATETIME NOT NULL, disable TINYINT(1) DEFAULT \'0\' NOT NULL, uncollectible TINYINT(1) DEFAULT \'0\' NOT NULL, idClient INT DEFAULT NULL, createdBy INT DEFAULT NULL, updatedBy INT DEFAULT NULL, INDEX IDX_1D78092CD3564642 (createdBy), INDEX IDX_1D78092CA455ACCF (idClient), INDEX IDX_1D78092CE8DE7170 (updatedBy), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB COMMENT = \'\' ');
  26.         $this->addSql('ALTER TABLE client_disable ADD CONSTRAINT FK_1D78092CA455ACCF FOREIGN KEY (idClient) REFERENCES clients (id)');
  27.         $this->addSql('ALTER TABLE client_disable ADD CONSTRAINT FK_1D78092CD3564642 FOREIGN KEY (createdBy) REFERENCES users (id)');
  28.         $this->addSql('ALTER TABLE client_disable ADD CONSTRAINT FK_1D78092CE8DE7170 FOREIGN KEY (updatedBy) REFERENCES users (id)');
  29.     }
  30. }