MigrationBase.php 596 B

1234567891011121314151617181920212223
  1. <?php
  2. namespace App\Migrations;
  3. use Doctrine\DBAL\Migrations\AbstractMigration;
  4. use Doctrine\DBAL\Schema\Schema;
  5. abstract class MigrationBase extends AbstractMigration {
  6. protected function ensureMySQL(): void {
  7. // this up() migration is auto-generated, please modify it to your needs
  8. $this->abortIf($this->connection->getDatabasePlatform()
  9. ->getName() !== 'mysql',
  10. 'Migration can only be executed safely on \'mysql\'.');
  11. }
  12. public function down(Schema $schema) {
  13. $this->ensureMySQL();
  14. }
  15. public function up(Schema $schema) {
  16. $this->ensureMySQL();
  17. }
  18. }