migrations/Version20230719121815.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. final class Version20230719121815 extends AbstractMigration
  7. {
  8.     public function getDescription(): string
  9.     {
  10.         return 'Create CPM table';
  11.     }
  12.     public function up(Schema $schema): void
  13.     {
  14.         $this->addSql("
  15.             CREATE TABLE `cpm`  (
  16.               `id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
  17.               `followers` int UNSIGNED NOT NULL,
  18.               `cpm` smallint UNSIGNED NOT NULL,
  19.               PRIMARY KEY (`id`),
  20.               UNIQUE INDEX `uniq_followers`(`followers`)
  21.             ) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB
  22.         ");
  23.     }
  24.     public function down(Schema $schema): void
  25.     {
  26.         $this->addSql("DROP TABLE IF EXISTS `cpm`");
  27.     }
  28. }