summaryrefslogtreecommitdiff
path: root/db/migrations/2019_09_07_000000_migrate_admin_schedule_permissions.php
diff options
context:
space:
mode:
authorIgor Scheller <igor.scheller@igorshp.de>2019-11-27 23:43:21 +0100
committerIgor Scheller <igor.scheller@igorshp.de>2019-12-08 02:20:48 +0100
commit42721e95726559b4a601240bb5b0fe4e5d755b2a (patch)
tree6810e05f845ca787acc1d02fa82d3df15cd0ef9b /db/migrations/2019_09_07_000000_migrate_admin_schedule_permissions.php
parent377b390c97afb9106fd9a139819d00306f996f24 (diff)
Added Schedule parsing and replaced old Fahrplan importer
Resolves #553 (Change Frab Import from xCal to XML) Resolves #538 (Feature Request: Multi Frab 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.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',
+ ]
+ );
+ }
+}