summaryrefslogtreecommitdiff
path: root/database/migrations/scorm_player_improvements.php.stub
diff options
context:
space:
mode:
Diffstat (limited to 'database/migrations/scorm_player_improvements.php.stub')
-rw-r--r--database/migrations/scorm_player_improvements.php.stub53
1 files changed, 53 insertions, 0 deletions
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');
+ });
+ }
+};