for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
declare(strict_types=1);
namespace App\Infrastructure\Migrations;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
final class Version20200507151039 extends AbstractMigration
{
public function getDescription(): string
return 'Initialize database';
}
public function up(Schema $schema): void
$this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('CREATE TABLE object_entry (
id CHAR(36) NOT NULL COMMENT \'(DC2Type:uuid)\',
`key` VARCHAR(255) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_bin`,
created_at timestamp not null,
`value` JSON DEFAULT NULL,
UNIQUE INDEX key_date_idx (`key`, created_at),
PRIMARY KEY(id)
) DEFAULT CHARACTER SET utf8mb4 COLLATE `utf8mb4_unicode_ci` ENGINE = InnoDB');
public function down(Schema $schema): void
$this->addSql('DROP TABLE object_entry');