<?php
declare(strict_types=1);
namespace DoctrineMigrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20230719121815 extends AbstractMigration
{
public function getDescription(): string
{
return 'Create CPM table';
}
public function up(Schema $schema): void
{
$this->addSql("
CREATE TABLE `cpm` (
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
`followers` int UNSIGNED NOT NULL,
`cpm` smallint UNSIGNED NOT NULL,
PRIMARY KEY (`id`),
UNIQUE INDEX `uniq_followers`(`followers`)
) DEFAULT CHARACTER SET utf8 COLLATE `utf8_unicode_ci` ENGINE = InnoDB
");
}
public function down(Schema $schema): void
{
$this->addSql("DROP TABLE IF EXISTS `cpm`");
}
}