Files
laraundfelix/database/migrations/2026_11_16_160000_library_completion.php
LarsandCursor c99a957e6f
Deploy Test / test (push) Successful in 17s
Deploy Test / deploy (push) Successful in 22s
Zeige Nutzbarkeit, Didaktik und oeffentliche Programmfassung
Co-authored-by: Cursor <cursoragent@cursor.com>
2026-11-16 08:33:19 +01:00

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']);
});
}
};