Stelle das U0-Fundament mit CMS, Mitgliedern und Filament bereit.
Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
1 parent
89b35ac480
commit
2035c46edd
130 files changed
+18519
-50
No files matched your search
@@ -0,0 +1,58 @@
|
||||
<?php
|
||||
|
||||
use Database\Seeders\CmsSeeder;
|
||||
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('pages', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('path')->unique();
|
||||
$table->unsignedBigInteger('published_revision_id')->nullable();
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
Schema::create('page_revisions', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->foreignId('page_id')->constrained()->cascadeOnDelete();
|
||||
$table->json('blocks');
|
||||
$table->string('seo_title')->nullable();
|
||||
$table->string('seo_description', 500)->nullable();
|
||||
$table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->timestamp('created_at')->useCurrent();
|
||||
});
|
||||
|
||||
Schema::table('pages', function (Blueprint $table) {
|
||||
$table->foreign('published_revision_id')
|
||||
->references('id')
|
||||
->on('page_revisions')
|
||||
->nullOnDelete();
|
||||
});
|
||||
|
||||
Schema::create('navigation_items', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->string('label');
|
||||
$table->foreignId('page_id')->nullable()->constrained()->nullOnDelete();
|
||||
$table->string('url')->nullable();
|
||||
$table->string('placement')->default('header');
|
||||
$table->unsignedInteger('sort_order')->default(0);
|
||||
$table->timestamps();
|
||||
});
|
||||
|
||||
(new CmsSeeder)->run();
|
||||
}
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('navigation_items');
|
||||
Schema::table('pages', function (Blueprint $table) {
|
||||
$table->dropForeign(['published_revision_id']);
|
||||
});
|
||||
Schema::dropIfExists('page_revisions');
|
||||
Schema::dropIfExists('pages');
|
||||
}
|
||||
};
|
||||
Reference in new issue
Block a user