- Datenmodell Property/Season/Extra (Beträge in Cent), Seeder mit Preisliste 2026 - PriceCalculator: Saison-Splitting, Mindestaufenthalt, Zusatzperson, Endreinigung, Extras, Anzahlung/Restzahlung - Filament-Verwaltung: Wohnungen, Saisons (Überschneidungsprüfung, Lückenwarnung, Kopie ins Folgejahr, Preisrechner), Zusatzleistungen - Tests für Preisberechnung und Saisonverwaltung Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
36 lines
901 B
PHP
36 lines
901 B
PHP
<?php
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
return new class extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*/
|
|
public function up(): void
|
|
{
|
|
Schema::create('seasons', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->foreignId('property_id')->constrained()->cascadeOnDelete();
|
|
$table->string('name');
|
|
$table->date('starts_on');
|
|
$table->date('ends_on');
|
|
$table->unsignedInteger('nightly_rate');
|
|
$table->unsignedTinyInteger('min_nights')->default(1);
|
|
$table->timestamps();
|
|
|
|
$table->index(['property_id', 'starts_on']);
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*/
|
|
public function down(): void
|
|
{
|
|
Schema::dropIfExists('seasons');
|
|
}
|
|
};
|