Club System

This commit is contained in:
2026-06-02 20:54:40 +02:00
parent 0b18d289ef
commit 6f6d6b9b84
6 changed files with 215 additions and 0 deletions

View File

@@ -0,0 +1,31 @@
<?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::table('entries', function (Blueprint $table) {
$table->softDeletes();
$table->text("staff_comment")->nullable()->after("state");
$table->timestamp("rejected_at")->nullable()->after("staff_comment");
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('entries', function (Blueprint $table) {
$table->dropSoftDeletes();
$table->dropColumn(['staff_comment', 'rejected_at']);
});
}
};

View File

@@ -0,0 +1,26 @@
<?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
{
DB::statement("ALTER TABLE entries MODIFY state ENUM('draft','pending','published','locked','rejected','hidden') NOT NULL DEFAULT 'draft'");
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('entries', function (Blueprint $table) {
//
});
}
};

View File

@@ -0,0 +1,27 @@
<?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::connection('hashes')->create('dat_reference', function (Blueprint $table) {
$table->id();
$table->string('name');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::connection('hashes')->dropIfExists('dat_reference');
}
};

View File

@@ -0,0 +1,30 @@
<?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::connection('hashes')->create('hashes', function (Blueprint $table) {
$table->id();
$table->string('filename')->nullable();
$table->string('crc32')->nullable()->index();
$table->string('sha1')->nullable()->index();
$table->foreignId('dat_reference_id')->constrained('dat_reference')->cascadeOnDelete();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::connection('hashes')->dropIfExists('hashes');
}
};