2022-05-06 17:42:18 +08:00
|
|
|
<?php
|
|
|
|
|
|
|
|
|
|
use Illuminate\Database\Migrations\Migration;
|
|
|
|
|
use Illuminate\Database\Schema\Blueprint;
|
|
|
|
|
use Illuminate\Support\Facades\Schema;
|
|
|
|
|
|
|
|
|
|
return new class extends Migration
|
|
|
|
|
{
|
|
|
|
|
/**
|
|
|
|
|
* Run the migrations.
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public function up()
|
|
|
|
|
{
|
2022-05-07 15:10:14 +08:00
|
|
|
if (Schema::hasTable('complains')) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
2022-05-06 17:42:18 +08:00
|
|
|
Schema::create('complains', function (Blueprint $table) {
|
|
|
|
|
$table->id();
|
|
|
|
|
$table->char('uuid', 36);
|
|
|
|
|
$table->string('email');
|
|
|
|
|
$table->text('body');
|
|
|
|
|
$table->dateTime('added');
|
|
|
|
|
$table->smallInteger('answered')->default(0);
|
|
|
|
|
});
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Reverse the migrations.
|
|
|
|
|
*
|
|
|
|
|
* @return void
|
|
|
|
|
*/
|
|
|
|
|
public function down()
|
|
|
|
|
{
|
|
|
|
|
Schema::dropIfExists('complains');
|
|
|
|
|
}
|
|
|
|
|
};
|