43 lines
1.5 KiB
PHP
43 lines
1.5 KiB
PHP
<?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 (['content_elements', 'compositions'] as $tableName) {
|
|
Schema::table($tableName, function (Blueprint $table) {
|
|
$table->string('thumbnail_path')->nullable();
|
|
$table->string('thumbnail_alt')->nullable();
|
|
$table->string('thumbnail_error')->nullable();
|
|
});
|
|
}
|
|
|
|
Schema::table('compositions', function (Blueprint $table) {
|
|
$table->string('public_slug')->nullable()->unique();
|
|
});
|
|
|
|
Schema::table('composition_versions', function (Blueprint $table) {
|
|
$table->text('learning_goal')->nullable();
|
|
$table->unsignedSmallInteger('duration_minutes')->nullable();
|
|
$table->text('material_note')->nullable();
|
|
});
|
|
}
|
|
|
|
public function down(): void
|
|
{
|
|
Schema::table('composition_versions', function (Blueprint $table) {
|
|
$table->dropColumn(['learning_goal', 'duration_minutes', 'material_note']);
|
|
});
|
|
Schema::table('compositions', function (Blueprint $table) {
|
|
$table->dropColumn(['thumbnail_path', 'thumbnail_alt', 'thumbnail_error', 'public_slug']);
|
|
});
|
|
Schema::table('content_elements', function (Blueprint $table) {
|
|
$table->dropColumn(['thumbnail_path', 'thumbnail_alt', 'thumbnail_error']);
|
|
});
|
|
}
|
|
};
|