migrations/Version20220715162357.php line 1

  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 Version20220715162357 extends AbstractMigration
  10. {
  11.     public function getDescription(): string
  12.     {
  13.         return '';
  14.     }
  15.     public function up(Schema $schema): void
  16.     {
  17.         $sql = <<<SQL
  18. CREATE TABLE user
  19. (
  20.     id       INT AUTO_INCREMENT NOT NULL,
  21.     email    VARCHAR(180)       NOT NULL,
  22.     roles    JSON               NOT NULL,
  23.     password VARCHAR(255)       NOT NULL,
  24.     UNIQUE INDEX UNIQ_8D93D649E7927C74 (email),
  25.     INDEX IDX_8D93D649E7927C74 (email),
  26.     PRIMARY KEY (id)
  27. ) DEFAULT CHARACTER SET utf8mb4
  28.   COLLATE `utf8mb4_unicode_ci`
  29.   ENGINE = InnoDB
  30. SQL;
  31.         // this up() migration is auto-generated, please modify it to your needs
  32.         $this->addSql($sql);
  33.     }
  34.     public function down(Schema $schema): void
  35.     {
  36.         $this->addSql('DROP TABLE user');
  37.     }
  38. }