diff --git a/src/Migrations/AbstractMultiPlatformMigration.php b/src/Migrations/AbstractMultiPlatformMigration.php index 3e5a7e8d..2d9066dd 100644 --- a/src/Migrations/AbstractMultiPlatformMigration.php +++ b/src/Migrations/AbstractMultiPlatformMigration.php @@ -11,6 +11,8 @@ use Scheb\TwoFactorBundle\Model\Email\TwoFactorInterface; abstract class AbstractMultiPlatformMigration extends AbstractMigration { + protected $permissions_updated = false; + public function up(Schema $schema): void { $db_type = $this->connection->getDatabasePlatform()->getName(); @@ -70,6 +72,18 @@ abstract class AbstractMultiPlatformMigration extends AbstractMigration return '$2y$10$36AnqCBS.YnHlVdM4UQ0oOCV7BjU7NmE0qnAVEex65AyZw1cbcEjq'; } + public function printPermissionUpdateMessage(): void + { + $this->permissions_updated = true; + //$this->write('[!!!] Permissions were updated! Please check if they fit your expectations!'); + } + + public function postUp(Schema $schema): void + { + parent::postUp($schema); + $this->write('[!!!] Permissions were updated! Please check if they fit your expectations!'); + } + abstract public function mySQLUp(Schema $schema): void; abstract public function mySQLDown(Schema $schema): void; diff --git a/src/Migrations/Version20190913141126.php b/src/Migrations/Version20190913141126.php index 05aa2db6..a62abac2 100644 --- a/src/Migrations/Version20190913141126.php +++ b/src/Migrations/Version20190913141126.php @@ -68,7 +68,7 @@ final class Version20190913141126 extends AbstractMultiPlatformMigration $this->addSql($sql); - $this->write('[!!!] Permissions were updated! Please check if they fit your expectations!'); + $this->printPermissionUpdateMessage(); } public function mySQLDown(Schema $schema): void diff --git a/src/Migrations/Version20200311204104.php b/src/Migrations/Version20200311204104.php index a8d5e3ba..9562f9d4 100644 --- a/src/Migrations/Version20200311204104.php +++ b/src/Migrations/Version20200311204104.php @@ -36,7 +36,7 @@ final class Version20200311204104 extends AbstractMultiPlatformMigration 'SET perms_parts_parameters = 681 WHERE (id = 2 AND name = "readonly");'; $this->addSql($sql); - $this->write('[!!!] Permissions were updated! Please check if they fit your expectations!'); + $this->printPermissionUpdateMessage(); } public function mySQLDown(Schema $schema): void diff --git a/src/Migrations/Version20200502161750.php b/src/Migrations/Version20200502161750.php index a55ceccf..5774158a 100644 --- a/src/Migrations/Version20200502161750.php +++ b/src/Migrations/Version20200502161750.php @@ -136,7 +136,7 @@ EOD; EOD; $this->addSql($sql); - + $this->printPermissionUpdateMessage(); } public function sqLiteDown(Schema $schema): void