Последняя версия с сервера прошлого разработчика
This commit is contained in:
46
nova/database/migrations/2018_01_01_000000_create_action_events_table.php
Executable file
46
nova/database/migrations/2018_01_01_000000_create_action_events_table.php
Executable file
@@ -0,0 +1,46 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class CreateActionEventsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::create('action_events', function (Blueprint $table) {
|
||||
$table->id();
|
||||
$table->char('batch_id', 36);
|
||||
$table->unsignedBigInteger('user_id')->index();
|
||||
$table->string('name');
|
||||
$table->string('actionable_type');
|
||||
$table->unsignedBigInteger('actionable_id');
|
||||
$table->string('target_type');
|
||||
$table->unsignedBigInteger('target_id');
|
||||
$table->string('model_type');
|
||||
$table->unsignedBigInteger('model_id')->nullable();
|
||||
$table->text('fields');
|
||||
$table->string('status', 25)->default('running');
|
||||
$table->text('exception');
|
||||
$table->timestamps();
|
||||
|
||||
$table->index(['actionable_type', 'actionable_id']);
|
||||
$table->index(['batch_id', 'model_type', 'model_id']);
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::dropIfExists('action_events');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
use Illuminate\Database\Migrations\Migration;
|
||||
use Illuminate\Database\Schema\Blueprint;
|
||||
use Illuminate\Support\Facades\Schema;
|
||||
|
||||
class AddFieldsToActionEventsTable extends Migration
|
||||
{
|
||||
/**
|
||||
* Run the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function up()
|
||||
{
|
||||
Schema::table('action_events', function (Blueprint $table) {
|
||||
$table->mediumText('original')->nullable();
|
||||
$table->mediumText('changes')->nullable();
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* Reverse the migrations.
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function down()
|
||||
{
|
||||
Schema::table('action_events', function (Blueprint $table) {
|
||||
$table->dropColumn('original', 'changes');
|
||||
});
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user