From 08908a314cb75dbcf51e6221c2f2c49d3a55d17f Mon Sep 17 00:00:00 2001
From: Sam Light <samlight1994@gmail.com>
Date: Mon, 5 Sep 2022 09:45:04 +0100
Subject: Implemented majority of the player functionality

---
 .../migrations/scorm_player_improvements.php.stub  | 53 ++++++++++++++++++++++
 1 file changed, 53 insertions(+)
 create mode 100644 database/migrations/scorm_player_improvements.php.stub

(limited to 'database/migrations/scorm_player_improvements.php.stub')

diff --git a/database/migrations/scorm_player_improvements.php.stub b/database/migrations/scorm_player_improvements.php.stub
new file mode 100644
index 0000000..4ee5d03
--- /dev/null
+++ b/database/migrations/scorm_player_improvements.php.stub
@@ -0,0 +1,53 @@
+<?php
+
+use Illuminate\Database\Migrations\Migration;
+use Illuminate\Database\Schema\Blueprint;
+use Illuminate\Support\Facades\Schema;
+
+return new class extends Migration
+{
+    /**
+     * Run the migrations.
+     *
+     * @return void
+     */
+    public function up()
+    {
+        Schema::table('scorm_sco_tracking', function (Blueprint $table) {
+            $table->renameColumn('exit_mode', 'exit');
+            $table->renameColumn('lesson_location', 'location');
+            $table->renameColumn('lesson_mode', 'mode');
+            $table->string('session_time')->change();
+        });
+
+        Schema::table('scorm', function (Blueprint $table) {
+            $table->unique('uuid');
+        });
+
+        Schema::table('scorm_sco', function (Blueprint $table) {
+            $table->unique('uuid');
+        });
+    }
+
+    /**
+     * Reverse the migrations.
+     *
+     * @return void
+     */
+    public function down()
+    {
+        Schema::table('scorm_sco_tracking', function (Blueprint $table) {
+            $table->renameColumn('exit', 'exit_mode');
+            $table->renameColumn('location', 'lesson_location');
+            $table->renameColumn('mode', 'lesson_mode');
+        });
+
+        Schema::table('scorm', function (Blueprint $table) {
+            $table->dropUnique('scorm_uuid_unique');
+        });
+
+        Schema::table('scorm_sco', function (Blueprint $table) {
+            $table->dropUnique('scorm_sco_uuid_unique');
+        });
+    }
+};
-- 
cgit v1.2.3