DigiComp.Sequence/Migrations/Mysql/Version20140505093853.php

38 lines
1.2 KiB
PHP
Raw Normal View History

2014-05-05 10:09:19 +02:00
<?php
2022-05-02 09:56:14 +02:00
declare(strict_types=1);
2017-03-13 16:59:04 +01:00
namespace Neos\Flow\Persistence\Doctrine\Migrations;
2014-05-05 10:09:19 +02:00
2021-09-08 16:42:05 +02:00
use Doctrine\DBAL\Exception as DoctrineDBALException;
use Doctrine\DBAL\Migrations\AbortMigrationException;
use Doctrine\DBAL\Schema\Schema;
2021-09-08 16:42:05 +02:00
use Doctrine\Migrations\AbstractMigration;
2014-05-05 10:09:19 +02:00
2016-06-24 19:40:43 +02:00
class Version20140505093853 extends AbstractMigration
{
/**
* @param Schema $schema
2021-09-08 16:42:05 +02:00
* @throws AbortMigrationException
* @throws DoctrineDBALException
2016-06-24 19:40:43 +02:00
*/
2021-09-08 16:42:05 +02:00
public function up(Schema $schema): void
2016-06-24 19:40:43 +02:00
{
2021-09-08 16:42:05 +02:00
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on "mysql".');
2014-05-05 10:25:11 +02:00
2020-03-11 17:24:48 +01:00
$this->addSql('CREATE TABLE digicomp_sequence_domain_model_insert (number INT NOT NULL, type VARCHAR(255) NOT NULL, PRIMARY KEY(number, type))');
2016-06-24 19:40:43 +02:00
}
2014-05-05 10:09:19 +02:00
2016-06-24 19:40:43 +02:00
/**
* @param Schema $schema
2021-09-08 16:42:05 +02:00
* @throws AbortMigrationException
* @throws DoctrineDBALException
2016-06-24 19:40:43 +02:00
*/
2021-09-08 16:42:05 +02:00
public function down(Schema $schema): void
2016-06-24 19:40:43 +02:00
{
2021-09-08 16:42:05 +02:00
$this->abortIf($this->connection->getDatabasePlatform()->getName() !== 'mysql', 'Migration can only be executed safely on "mysql".');
2014-05-05 10:25:11 +02:00
2020-03-11 17:24:48 +01:00
$this->addSql('DROP TABLE digicomp_sequence_domain_model_insert');
2016-06-24 19:40:43 +02:00
}
}