Zentralen Belegungsplan und plattformuebergreifende Buchungs- und Gaesteverwaltung integrieren
Deploy FeWo mit PipelineManager / deploy (push) Successful in 2m41s
Deploy FeWo mit PipelineManager / deploy (push) Successful in 2m41s
This commit is contained in:
1 parent
c74199e978
commit
f369018a68
41 files changed
+1343
-157
No files matched your search
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\DB;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*/
|
||||
public function up(): void
|
||||
{
|
||||
Schema::table('blocked_periods', function (Blueprint $table) {
|
||||
$table->foreignId('guest_id')->nullable()->constrained()->nullOnDelete();
|
||||
$table->string('occupation_kind', 30)->nullable();
|
||||
});
|
||||
Schema::table('guests', function (Blueprint $table) {
|
||||
$table->string('email')->nullable()->change();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*/
|
||||
public function down(): void
|
||||
{
|
||||
if (DB::table('guests')->whereNull('email')->exists()) {
|
||||
throw new RuntimeException('Gäste ohne E-Mail zuerst vervollständigen; das vorherige Schema erlaubt keine fehlenden E-Mail-Adressen.');
|
||||
}
|
||||
Schema::table('guests', function (Blueprint $table) {
|
||||
$table->string('email')->nullable(false)->change();
|
||||
});
|
||||
Schema::table('blocked_periods', function (Blueprint $table) {
|
||||
$table->dropConstrainedForeignId('guest_id');
|
||||
$table->dropColumn('occupation_kind');
|
||||
});
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user