Added support for SQLite.

This commit is contained in:
Jan Böhmer 2020-06-13 23:58:59 +02:00
parent bd1da1ce5e
commit 74e4c4d0d1
12 changed files with 340 additions and 40 deletions

View file

@ -4,20 +4,21 @@ declare(strict_types=1);
namespace DoctrineMigrations;
use App\Migrations\AbstractMultiPlatformMigration;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20200409130946 extends AbstractMigration
final class Version20200409130946 extends AbstractMultiPlatformMigration
{
public function getDescription(): string
{
return '';
}
public function up(Schema $schema): void
public function mySQLUp(Schema $schema): void
{
// this up() migration is auto-generated, please modify it to your needs
$this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');
@ -25,11 +26,21 @@ final class Version20200409130946 extends AbstractMigration
$this->addSql('ALTER TABLE u2f_keys CHANGE key_handle key_handle VARCHAR(128) NOT NULL');
}
public function down(Schema $schema): void
public function mySQLDown(Schema $schema): void
{
// this down() migration is auto-generated, please modify it to your needs
$this->abortIf('mysql' !== $this->connection->getDatabasePlatform()->getName(), 'Migration can only be executed safely on \'mysql\'.');
$this->addSql('ALTER TABLE u2f_keys CHANGE key_handle key_handle VARCHAR(64) CHARACTER SET utf8mb4 NOT NULL COLLATE `utf8mb4_unicode_ci`');
}
public function sqLiteUp(Schema $schema): void
{
$this->skipIf(true, "Migration not needed for SQLite. Skipping...");
}
public function sqLiteDown(Schema $schema): void
{
$this->skipIf(true, "Migration not needed for SQLite. Skipping...");
}
}