First commit
This commit is contained in:
commit
7cf3558ba7
12933 changed files with 1180047 additions and 0 deletions
|
|
@ -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
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('flux_cms_pages', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('domain_key')->index();
|
||||
$table->json('title'); // Übersetzbarer Seitentitel
|
||||
$table->json('meta_description')->nullable(); // SEO Meta Description
|
||||
$table->json('meta_keywords')->nullable(); // SEO Keywords
|
||||
$table->json('og_image')->nullable(); // Open Graph Image (Media Library Reference)
|
||||
$table->string('canonical_url')->nullable(); // SEO Canonical URL
|
||||
$table->json('settings')->nullable(); // Zusätzliche Einstellungen
|
||||
$table->boolean('is_published')->default(true);
|
||||
$table->timestamp('published_at')->nullable();
|
||||
$table->timestamps();
|
||||
|
||||
// Composite indexes for performance
|
||||
$table->index(['domain_key', 'is_published']);
|
||||
$table->index(['domain_key', 'is_published', 'published_at']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('flux_cms_pages');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
<?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('flux_cms_page_components', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('page_id')->constrained('flux_cms_pages')->onDelete('cascade');
|
||||
$table->string('component_class'); // Full namespace of the component class
|
||||
$table->integer('order')->default(0);
|
||||
$table->json('content'); // Alle übersetzten Inhalte der Komponente
|
||||
$table->json('settings')->nullable(); // Komponenten-spezifische Einstellungen
|
||||
$table->boolean('is_active')->default(true);
|
||||
$table->timestamps();
|
||||
|
||||
// Indexes for performance
|
||||
$table->index(['page_id', 'order']);
|
||||
$table->index(['page_id', 'is_active']);
|
||||
$table->index(['component_class']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('flux_cms_page_components');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,33 @@
|
|||
<?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('flux_cms_page_versions', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('page_id')->constrained('flux_cms_pages')->onDelete('cascade');
|
||||
$table->json('page_data'); // Snapshot der kompletten Seite
|
||||
$table->json('components_data'); // Snapshot aller Komponenten
|
||||
$table->string('version_name')->nullable(); // Benutzerdefinierter Name
|
||||
$table->text('change_description')->nullable(); // Was wurde geändert
|
||||
$table->string('created_by_type')->nullable(); // Polymorphic relation type
|
||||
$table->unsignedBigInteger('created_by_id')->nullable(); // Polymorphic relation id
|
||||
$table->timestamps();
|
||||
|
||||
// Indexes
|
||||
$table->index('page_id');
|
||||
$table->index(['page_id', 'created_at']);
|
||||
$table->index(['created_by_type', 'created_by_id']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('flux_cms_page_versions');
|
||||
}
|
||||
};
|
||||
|
|
@ -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
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('flux_cms_navigations', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('domain_key')->index();
|
||||
$table->string('name'); // z.B. 'main', 'footer', 'sidebar'
|
||||
$table->json('display_name'); // Übersetzbarer Anzeigename
|
||||
$table->json('settings')->nullable(); // Navigation-spezifische Einstellungen
|
||||
$table->boolean('is_active')->default(true);
|
||||
$table->timestamps();
|
||||
|
||||
// Unique constraint
|
||||
$table->unique(['domain_key', 'name']);
|
||||
$table->index(['domain_key', 'is_active']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('flux_cms_navigations');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,35 @@
|
|||
<?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('flux_cms_navigation_items', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('navigation_id')->constrained('flux_cms_navigations')->onDelete('cascade');
|
||||
$table->foreignId('page_id')->nullable()->constrained('flux_cms_pages')->onDelete('cascade');
|
||||
$table->string('external_url')->nullable();
|
||||
$table->json('label'); // Übersetzbarer Menütext
|
||||
$table->integer('order')->default(0);
|
||||
$table->foreignId('parent_id')->nullable()->constrained('flux_cms_navigation_items')->onDelete('cascade');
|
||||
$table->json('settings')->nullable(); // Item-spezifische Einstellungen
|
||||
$table->boolean('is_active')->default(true);
|
||||
$table->boolean('opens_in_new_tab')->default(false);
|
||||
$table->timestamps();
|
||||
|
||||
// Indexes
|
||||
$table->index(['navigation_id', 'order']);
|
||||
$table->index(['navigation_id', 'parent_id']);
|
||||
$table->index(['navigation_id', 'is_active']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('flux_cms_navigation_items');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,40 @@
|
|||
<?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('flux_cms_blog_posts', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('domain_key')->index();
|
||||
$table->json('title'); // Übersetzbarer Titel
|
||||
$table->json('excerpt')->nullable(); // Übersetzbarer Kurztext
|
||||
$table->json('content'); // Übersetzbarer Haupttext
|
||||
$table->json('meta_description')->nullable(); // SEO
|
||||
$table->json('meta_keywords')->nullable(); // SEO
|
||||
$table->json('og_image')->nullable(); // Open Graph Image
|
||||
$table->json('settings')->nullable(); // Post-spezifische Einstellungen
|
||||
$table->boolean('is_published')->default(false);
|
||||
$table->boolean('is_featured')->default(false);
|
||||
$table->timestamp('published_at')->nullable();
|
||||
$table->string('author_type')->nullable(); // Polymorphic relation type
|
||||
$table->unsignedBigInteger('author_id')->nullable(); // Polymorphic relation id
|
||||
$table->timestamps();
|
||||
|
||||
// Indexes
|
||||
$table->index(['domain_key', 'is_published']);
|
||||
$table->index(['domain_key', 'is_published', 'published_at']);
|
||||
$table->index(['domain_key', 'is_featured']);
|
||||
$table->index(['author_type', 'author_id']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('flux_cms_blog_posts');
|
||||
}
|
||||
};
|
||||
|
|
@ -0,0 +1,32 @@
|
|||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up()
|
||||
{
|
||||
Schema::create('tags', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->json('name');
|
||||
$table->json('slug');
|
||||
$table->string('type')->nullable();
|
||||
$table->integer('order_column')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('taggables', function (Blueprint $table) {
|
||||
$table->foreignId('tag_id')->constrained()->cascadeOnDelete();
|
||||
$table->morphs('taggable');
|
||||
$table->unique(['tag_id', 'taggable_id', 'taggable_type']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('taggables');
|
||||
Schema::dropIfExists('tags');
|
||||
}
|
||||
};
|
||||
|
|
@ -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
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('flux_cms_slugs', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->morphs('model');
|
||||
$table->string('locale')->index();
|
||||
$table->string('slug');
|
||||
$table->timestamps();
|
||||
|
||||
$table->unique(['locale', 'slug']);
|
||||
});
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('flux_cms_slugs');
|
||||
}
|
||||
};
|
||||
Loading…
Add table
Add a link
Reference in a new issue