first commit

This commit is contained in:
Nils Bonorden committed 2025-10-17 08:08:34 +02:00
commit fcae679714
75 files changed
+12701

No files matched your search

@@ -0,0 +1,44 @@
<?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
{
Schema::create('bewerbungen', function (Blueprint $table) {
$table->id();
// Basisdaten
$table->string('name', 255);
$table->text('text'); // Bewerbungstext ist i.d.R. länger als 255
// Dateien (optional) – Pfade in /storage/app/public/...
$table->string('pic_path', 2048)->nullable();
$table->string('bedingungen_path', 2048)->nullable();
// Status & Zeitsteuerung
$table->boolean('active')->default(true)->index(); // "aktiv" -> lieber englisch/konsequent
$table->boolean('timed')->default(false)->index(); // ob zeitgesteuert
// Zeitraum (optional, wenn timed = true)
$table->timestamp('start_at')->nullable()->index();
$table->timestamp('end_at')->nullable()->index();
$table->timestampsTz();
$table->softDeletesTz();
});
// OPTIONAL: DB-Check (MySQL 8+/Postgres) – nur wenn deine DB & Laravel-Version das unterstützen
// Schema::table('bewerbungen', function (Blueprint $table) {
// $table->check('(end_at IS NULL OR start_at IS NULL OR end_at >= start_at)');
// });
}
public function down(): void
{
Schema::dropIfExists('bewerbungen');
}
};