migrations/Version20190715125724.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 Version20190715125724 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('CREATE TABLE event_type (id INT AUTO_INCREMENT NOT NULL, created_by INT DEFAULT NULL, updated_by INT DEFAULT NULL, code VARCHAR(32) NOT NULL, type SMALLINT NOT NULL, include_in_website_search TINYINT(1) NOT NULL, enrolment_details LONGTEXT NOT NULL, duration_details LONGTEXT NOT NULL, contact_name VARCHAR(255) NOT NULL, contact_email VARCHAR(255) NOT NULL, contact_phone VARCHAR(255) NOT NULL, price NUMERIC(8, 2) NOT NULL, fee NUMERIC(8, 2) NOT NULL, event_notes LONGTEXT DEFAULT NULL, created_at DATETIME NOT NULL, updated_at DATETIME NOT NULL, name VARCHAR(255) NOT NULL, INDEX IDX_93151B82DE12AB56 (created_by), INDEX IDX_93151B8216FE72E1 (updated_by), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci ENGINE = InnoDB');
  20.         $this->addSql('ALTER TABLE event_type ADD CONSTRAINT FK_93151B82DE12AB56 FOREIGN KEY (created_by) REFERENCES fos_user (id)');
  21.         $this->addSql('ALTER TABLE event_type ADD CONSTRAINT FK_93151B8216FE72E1 FOREIGN KEY (updated_by) REFERENCES fos_user (id)');
  22.     }
  23.     public function down(Schema $schema) : void
  24.     {
  25.         // this down() migration is auto-generated, please modify it to your needs
  26.         $this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql''Migration can only be executed safely on \'mysql\'.');
  27.         $this->addSql('DROP TABLE event_type');
  28.     }
  29. }