A lot of things

This commit is contained in:
2026-06-16 16:21:43 +02:00
parent 4f9f6c63b3
commit 7e1e26f20b
126 changed files with 7917 additions and 204 deletions

View File

@@ -23,7 +23,6 @@ return new class extends Migration
$table->longText( 'description' );
$table->string( 'main_image' )->nullable();
// TODO: Replace it by state.
$table->enum( 'state', [ 'draft', 'pending', 'published', 'locked', 'hidden' ] )->default('draft');
$table->boolean('featured')->default(false);

View File

@@ -12,7 +12,22 @@ return new class extends Migration
public function up(): void
{
Schema::create('news', function (Blueprint $table) {
$table->id();
$table->string('title');
$table->string('slug')->unique();
$table->foreignId('category_id')->nullable()->constrained('categories')->nullOnDelete();
$table->longText('description');
$table->enum('state', [ 'draft', 'pending', 'published', 'locked', 'rejected', 'hidden' ] )->default('draft');
$table->foreignId('entry_id')->nullable()->constrained('entries')->nullOnDelete();
$table->string('relevant_link', 500 )->nullable();
$table->string('youtube_link', 500 )->nullable();
$table->unsignedBigInteger( 'user_id' ); // xf_user_id
$table->unsignedBigInteger( 'comments_thread_id' )->nullable(); // xf_thread
$table->softDeletes();
$table->timestamps();
});
}

View File

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

View File

@@ -0,0 +1,28 @@
<?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('galleries', function (Blueprint $table) {
$table->unsignedSmallInteger('order')->default(0)->after('image');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('galleries', function (Blueprint $table) {
$table->dropColumn('order');
});
}
};

View File

@@ -0,0 +1,28 @@
<?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->dateTime('featured_at')->nullable()->after('featured');
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('entries', function (Blueprint $table) {
$table->dropColumn('featured_at');
});
}
};

View File

@@ -0,0 +1,34 @@
<?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('play_online_settings', function (Blueprint $table) {
$table->unsignedBigInteger('file_id')->primary();
$table->foreign('file_id')
->references('id')
->on('entry_files')
->onDelete('cascade');
$table->string('core', 30);
$table->boolean('threads')->default(false);
$table->timestamps();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::dropIfExists('play_online_settings');
}
};

View File

@@ -0,0 +1,28 @@
<?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('platforms', function (Blueprint $table) {
$table->string('play_online_core')->nullable()->default(null);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('platforms', function (Blueprint $table) {
$table->dropColumn('play_online_core');
});
}
};

View File

@@ -0,0 +1,23 @@
<?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('activity_log', function (Blueprint $table) {
$table->id();
$table->string('log_name')->nullable()->index();
$table->text('description');
$table->nullableMorphs('subject', 'subject');
$table->string('event')->nullable();
$table->nullableMorphs('causer', 'causer');
$table->json('attribute_changes')->nullable();
$table->json('properties')->nullable();
$table->timestamps();
});
}
};

View File

@@ -0,0 +1,28 @@
<?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('entry_files', function (Blueprint $table) {
$table->unsignedBigInteger('download_count')->default(0);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::table('entry_files', function (Blueprint $table) {
$table->dropColumn('download_count');
});
}
};

View File

@@ -0,0 +1,29 @@
<?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('discord')->create('actions', function (Blueprint $table) {
$table->id();
$table->string('action');
$table->json('data');
$table->boolean('done')->default(false);
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::connection('discord')->dropIfExists('actions');
}
};

View File

@@ -0,0 +1,28 @@
<?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('discord')->table('actions', function (Blueprint $table) {
$table->string('errors')->nullable();
});
}
/**
* Reverse the migrations.
*/
public function down(): void
{
Schema::connection('discord')->table('actions', function (Blueprint $table) {
$table->dropColumn('errors');
});
}
};