migrations/Version20221207101604.php line 1

Open in your IDE?
  1. <?php
  2. /* @noinspection PhpUnused */
  3. declare(strict_types=1);
  4. namespace DoctrineMigrations;
  5. use Doctrine\DBAL\Schema\Schema;
  6. use Doctrine\Migrations\AbstractMigration;
  7. /**
  8.  * Auto-generated Migration: Please modify to your needs!
  9.  *
  10.  * @package API
  11.  * @internal
  12.  */
  13. final class Version20221207101604 extends AbstractMigration
  14. {
  15.     public function down(Schema $schema): void
  16.     {
  17.         // this down() migration is auto-generated, please modify it to your needs
  18.         $this->addSql('DROP TABLE session');
  19.     }
  20.     public function getDescription(): string
  21.     {
  22.         return
  23.             "- Introduces session table.";
  24.     }
  25.     public function up(Schema $schema): void
  26.     {
  27.         // this up() migration is auto-generated, please modify it to your needs
  28.         $this->addSql(
  29.             '
  30.                 CREATE TABLE `session` (
  31.                     `id` VARBINARY(128) NOT NULL COMMENT \'Session ID\',
  32.                     `data` BLOB NOT NULL COMMENT \'Session data\',
  33.                     `lifetime` INT NOT NULL COMMENT \'Session lifetime\',
  34.                     `created` INT NOT NULL COMMENT \'Session creation time\',
  35.                     `user_id` INT DEFAULT NULL COMMENT \'Session custom user ID\',
  36.                     INDEX `sessions_sess_lifetime_idx` (`lifetime`),
  37.                     INDEX `sessions_sess_user_id_idx` (`user_id`),
  38.                     PRIMARY KEY(id)
  39.                 ) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB
  40.             '
  41.         );
  42.     }
  43. }