diff options
author | msquare <msquare@notrademark.de> | 2019-12-08 11:48:58 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-12-08 11:48:58 +0100 |
commit | a3a938a1210f1bfb2680c25b2bcf53e47444bdba (patch) | |
tree | fd4c13fd9b714c0d8c60b6d3fe3e2fc88b82b717 /db/migrations/2019_09_07_000000_migrate_admin_schedule_permissions.php | |
parent | b540ac93856065ce6e145930b6611e0a0946d646 (diff) | |
parent | 064a1750279be244f86cf24f29749b391b11f1dd (diff) |
Merge pull request #685 from MyIgel/schedule-import
Rebuild Schedule import
Diffstat (limited to 'db/migrations/2019_09_07_000000_migrate_admin_schedule_permissions.php')
-rw-r--r-- | db/migrations/2019_09_07_000000_migrate_admin_schedule_permissions.php | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/db/migrations/2019_09_07_000000_migrate_admin_schedule_permissions.php b/db/migrations/2019_09_07_000000_migrate_admin_schedule_permissions.php new file mode 100644 index 00000000..e39e22d8 --- /dev/null +++ b/db/migrations/2019_09_07_000000_migrate_admin_schedule_permissions.php @@ -0,0 +1,48 @@ +<?php + +namespace Engelsystem\Migrations; + +use Engelsystem\Database\Migration\Migration; + +class MigrateAdminSchedulePermissions extends Migration +{ + /** + * Run the migration + */ + public function up() + { + if (!$this->schema->hasTable('Privileges')) { + return; + } + + $this->schema->getConnection() + ->table('Privileges') + ->where('name', 'admin_import') + ->update( + [ + 'name' => 'schedule.import', + 'desc' => 'Import rooms and shifts from schedule.xml', + ] + ); + } + + /** + * Reverse the migration + */ + public function down() + { + if (!$this->schema->hasTable('Privileges')) { + return; + } + + $this->schema->getConnection() + ->table('Privileges') + ->where('name', 'schedule.import') + ->update( + [ + 'name' => 'admin_import', + 'desc' => 'Import rooms and shifts from schedule.xcs/schedule.xcal', + ] + ); + } +} |