2020-09-28 00:24:33 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
|
2020-10-03 19:44:12 +02:00
|
|
|
class CreateDeletionsTable extends Migration
|
2020-09-28 00:24:33 +02:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Run the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function up()
|
|
|
|
{
|
2020-10-03 19:44:12 +02:00
|
|
|
Schema::create('deletions', function (Blueprint $table) {
|
2020-09-28 00:24:33 +02:00
|
|
|
$table->increments('id');
|
|
|
|
$table->integer('deleted_by');
|
|
|
|
$table->string('deletable_type', 100);
|
|
|
|
$table->integer('deletable_id');
|
|
|
|
$table->timestamps();
|
|
|
|
|
|
|
|
$table->index('deleted_by');
|
|
|
|
$table->index('deletable_type');
|
|
|
|
$table->index('deletable_id');
|
|
|
|
});
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Reverse the migrations.
|
|
|
|
*
|
|
|
|
* @return void
|
|
|
|
*/
|
|
|
|
public function down()
|
|
|
|
{
|
2020-10-03 19:44:12 +02:00
|
|
|
Schema::dropIfExists('deletions');
|
2020-09-28 00:24:33 +02:00
|
|
|
}
|
|
|
|
}
|