![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/syn.corals.io/Corals/modules/CMS/database/migrations/ |
<?php namespace Corals\Modules\CMS\database\migrations; use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; class BlockTables extends Migration { /** * Run the migrations. * * @return void */ public function up() { Schema::create('cms_blocks', function (Blueprint $table) { $table->increments('id'); $table->string('name')->unique(); $table->string('key')->unique()->index(); $table->enum('status', ['active', 'inactive'])->default('active'); $table->boolean('as_row')->default(true); $table->unsignedInteger('created_by')->nullable()->index(); $table->unsignedInteger('updated_by')->nullable()->index(); $table->timestamps(); }); Schema::create('cms_widgets', function (Blueprint $table) { $table->increments('id'); $table->string('title')->nullable(); $table->unsignedInteger('widget_order')->default(0); $table->unsignedInteger('widget_width')->nullable(); $table->text('content')->nullable(); $table->unsignedInteger('block_id'); $table->enum('status', ['active', 'inactive'])->default('active'); $table->unsignedInteger('created_by')->nullable()->index(); $table->unsignedInteger('updated_by')->nullable()->index(); $table->timestamps(); $table->foreign('block_id')->references('id')->on('cms_blocks')->onDelete('cascade')->onUpdate('cascade'); }); } /** * Reverse the migrations. * * @return void */ public function down() { Schema::dropIfExists('cms_widgets'); Schema::dropIfExists('cms_blocks'); } }