mirror of
https://github.com/Part-DB/Part-DB-server.git
synced 2026-03-05 23:15:50 +01:00
Centralized permission updated message for migrations.
This commit is contained in:
@@ -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('<question>[!!!] Permissions were updated! Please check if they fit your expectations!</question>');
|
||||
}
|
||||
|
||||
public function postUp(Schema $schema): void
|
||||
{
|
||||
parent::postUp($schema);
|
||||
$this->write('<question>[!!!] Permissions were updated! Please check if they fit your expectations!</question>');
|
||||
}
|
||||
|
||||
abstract public function mySQLUp(Schema $schema): void;
|
||||
|
||||
abstract public function mySQLDown(Schema $schema): void;
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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('<question>[!!!] Permissions were updated! Please check if they fit your expectations!</question>');
|
||||
$this->printPermissionUpdateMessage();
|
||||
}
|
||||
|
||||
public function mySQLDown(Schema $schema): void
|
||||
|
||||
@@ -136,7 +136,7 @@ EOD;
|
||||
EOD;
|
||||
$this->addSql($sql);
|
||||
|
||||
|
||||
$this->printPermissionUpdateMessage();
|
||||
}
|
||||
|
||||
public function sqLiteDown(Schema $schema): void
|
||||
|
||||
Reference in New Issue
Block a user