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

@ -22,6 +22,7 @@ declare(strict_types=1);
namespace DoctrineMigrations;
use App\Migrations\AbstractMultiPlatformMigration;
use Doctrine\DBAL\DBALException;
use Doctrine\DBAL\Schema\Schema;
use Doctrine\Migrations\AbstractMigration;
@ -29,14 +30,14 @@ use Doctrine\Migrations\AbstractMigration;
/**
* Auto-generated Migration: Please modify to your needs!
*/
final class Version20190902140506 extends AbstractMigration
final class Version20190902140506 extends AbstractMultiPlatformMigration
{
public function getDescription(): string
{
return 'Upgrade database from old Part-DB 0.5 Version (dbVersion 26)';
}
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\'.');
@ -192,7 +193,7 @@ final class Version20190902140506 extends AbstractMigration
$this->addSql("UPDATE `internal` SET `keyValue` = '99' WHERE `internal`.`keyName` = 'dbVersion'");
}
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\'.');
@ -316,4 +317,14 @@ final class Version20190902140506 extends AbstractMigration
$this->addSql('DROP INDEX uniq_1483a5e95e237e06 ON `users`');
$this->addSql('CREATE UNIQUE INDEX name ON `users` (name)');
}
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...");
}
}