style updates
This commit is contained in:
@@ -1,31 +1,58 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
return new class extends Migration {
|
||||
|
||||
return new class extends Migration
|
||||
{
|
||||
public function up(): void
|
||||
{
|
||||
Schema::create('builder_documents', function (Blueprint $table) {
|
||||
$table->id(); $table->foreignId('site_id')->nullable()->constrained('sites')->nullOnDelete();
|
||||
$table->string('type',30)->index(); $table->string('name'); $table->string('slug')->nullable();
|
||||
$table->string('status',20)->default('draft')->index(); $table->unsignedInteger('version')->default(1);
|
||||
$table->json('document')->nullable(); $table->json('settings')->nullable();
|
||||
$table->nullableMorphs('buildable'); $table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->id();
|
||||
$table->foreignId('site_id')->nullable()->constrained('sites')->nullOnDelete();
|
||||
$table->string('type', 30)->index();
|
||||
$table->string('name');
|
||||
$table->string('slug')->nullable();
|
||||
$table->string('status', 20)->default('draft')->index();
|
||||
$table->unsignedInteger('version')->default(1);
|
||||
$table->json('document')->nullable();
|
||||
$table->json('settings')->nullable();
|
||||
$table->nullableMorphs('buildable');
|
||||
$table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->foreignId('updated_by')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->timestamp('published_at')->nullable(); $table->timestamps();
|
||||
$table->unique(['site_id','type','slug'],'builder_document_site_type_slug_unique');
|
||||
$table->timestamp('published_at')->nullable();
|
||||
$table->timestamps();
|
||||
$table->unique(['site_id', 'type', 'slug'], 'builder_document_site_type_slug_unique');
|
||||
});
|
||||
Schema::create('builder_document_versions', function (Blueprint $table) {
|
||||
$table->id(); $table->foreignId('builder_document_id')->constrained('builder_documents')->cascadeOnDelete();
|
||||
$table->unsignedInteger('version'); $table->json('document'); $table->json('settings')->nullable();
|
||||
$table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete(); $table->timestamps();
|
||||
$table->unique(['builder_document_id','version']);
|
||||
$table->id();
|
||||
$table->foreignId('builder_document_id')->constrained('builder_documents')->cascadeOnDelete();
|
||||
$table->unsignedInteger('version');
|
||||
$table->json('document');
|
||||
$table->json('settings')->nullable();
|
||||
$table->foreignId('created_by')->nullable()->constrained('users')->nullOnDelete();
|
||||
$table->timestamps();
|
||||
$table->unique(['builder_document_id', 'version']);
|
||||
});
|
||||
Schema::create('builder_templates', function (Blueprint $table) {
|
||||
$table->id(); $table->string('type',30)->index(); $table->string('name'); $table->string('slug')->unique();
|
||||
$table->text('description')->nullable(); $table->json('document'); $table->json('settings')->nullable();
|
||||
$table->boolean('is_system')->default(false); $table->boolean('is_active')->default(true)->index(); $table->timestamps();
|
||||
$table->id();
|
||||
$table->string('type', 30)->index();
|
||||
$table->string('name');
|
||||
$table->string('slug')->unique();
|
||||
$table->text('description')->nullable();
|
||||
$table->json('document');
|
||||
$table->json('settings')->nullable();
|
||||
$table->boolean('is_system')->default(false);
|
||||
$table->boolean('is_active')->default(true)->index();
|
||||
$table->timestamps();
|
||||
});
|
||||
}
|
||||
public function down(): void { Schema::dropIfExists('builder_templates'); Schema::dropIfExists('builder_document_versions'); Schema::dropIfExists('builder_documents'); }
|
||||
|
||||
public function down(): void
|
||||
{
|
||||
Schema::dropIfExists('builder_templates');
|
||||
Schema::dropIfExists('builder_document_versions');
|
||||
Schema::dropIfExists('builder_documents');
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user