|
|
@@ -0,0 +1,36 @@
|
|
|
+<?php
|
|
|
+
|
|
|
+use Illuminate\Database\Migrations\Migration;
|
|
|
+use Illuminate\Database\Schema\Blueprint;
|
|
|
+use Illuminate\Support\Facades\Schema;
|
|
|
+
|
|
|
+return new class extends Migration
|
|
|
+{
|
|
|
+ public function up(): void
|
|
|
+ {
|
|
|
+ foreach (['class_packages', 'class_package_units'] as $tableName) {
|
|
|
+ Schema::table($tableName, function (Blueprint $table) {
|
|
|
+ $table->unsignedSmallInteger('class_duration_minutes')->default(120);
|
|
|
+ $table->unsignedTinyInteger('weekday')->nullable();
|
|
|
+ $table->time('start_time')->nullable();
|
|
|
+ $table->unsignedTinyInteger('second_weekday')->nullable();
|
|
|
+ $table->time('second_start_time')->nullable();
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ public function down(): void
|
|
|
+ {
|
|
|
+ foreach (['class_packages', 'class_package_units'] as $tableName) {
|
|
|
+ Schema::table($tableName, function (Blueprint $table) {
|
|
|
+ $table->dropColumn([
|
|
|
+ 'class_duration_minutes',
|
|
|
+ 'weekday',
|
|
|
+ 'start_time',
|
|
|
+ 'second_weekday',
|
|
|
+ 'second_start_time',
|
|
|
+ ]);
|
|
|
+ });
|
|
|
+ }
|
|
|
+ }
|
|
|
+};
|