![]() 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/ledger.corals.io/Corals/modules/Utility/database/migrations/ |
<?php namespace Corals\Modules\Utility\database\migrations; use Illuminate\Database\Schema\Blueprint; use Illuminate\Database\Migrations\Migration; use Illuminate\Support\Facades\Schema; class CreateTagTables extends Migration { public function up() { Schema::create('utility_tags', function (Blueprint $table) { $table->increments('id'); $table->string('name'); $table->string('slug'); $table->nullableMorphs('source'); $table->enum('status', ['active', 'inactive'])->default('active'); $table->string('module')->nullable(); $table->text('properties')->nullable(); $table->unsignedInteger('created_by')->nullable()->index(); $table->unsignedInteger('updated_by')->nullable()->index(); $table->softDeletes(); $table->timestamps(); }); Schema::create('utility_taggables', function (Blueprint $table) { $table->integer('tag_id')->unsigned(); $table->integer('taggable_id')->unsigned(); $table->string('taggable_type'); $table->foreign('tag_id')->references('id')->on('utility_tags')->onDelete('cascade'); }); } public function down() { Schema::dropIfExists('utility_taggables'); Schema::dropIfExists('utility_tags'); } }