mirror of
https://gitlab.com/CIEFWorldwideSdnBhd/exchange-2.0.git
synced 2026-08-19 04:23:55 +00:00
42 lines
1018 B
PHP
42 lines
1018 B
PHP
<?php
|
|
|
|
use App\Classes\ValueObjects\Constants\RemarkTypes;
|
|
use Illuminate\Database\Migrations\Migration;
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
class CreateRemarksTable extends Migration
|
|
{
|
|
/**
|
|
* Run the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function up()
|
|
{
|
|
Schema::create('remarks', function (Blueprint $table) {
|
|
$table->id();
|
|
$table->morphs('owner');
|
|
$table->bigInteger('commenter_id')->unsigned()->index();
|
|
$table->string('content',200);
|
|
$table->integer('type')->default(RemarkTypes::INTERNAL);
|
|
$table->softDeletes();
|
|
$table->timestamps();
|
|
});
|
|
|
|
Schema::table('remarks', function (Blueprint $table) {
|
|
$table->string('owner_type', 191)->change();
|
|
});
|
|
}
|
|
|
|
/**
|
|
* Reverse the migrations.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function down()
|
|
{
|
|
Schema::dropIfExists('remarks');
|
|
}
|
|
}
|