summaryrefslogtreecommitdiff
path: root/db/migrations/2019_09_07_000000_migrate_admin_schedule_permissions.php
diff options
context:
space:
mode:
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.php48
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',
+ ]
+ );
+ }
+}