Files
nexusphp/database/migrations/2021_06_08_113437_create_bans_table.php

40 lines
958 B
PHP
Raw Normal View History

<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
class CreateBansTable extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
2021-06-09 15:11:02 +08:00
if (Schema::hasTable('bans')) {
return;
}
Schema::create('bans', function (Blueprint $table) {
$table->smallIncrements('id');
$table->dateTime('added')->nullable();
$table->unsignedMediumInteger('addedby')->default(0);
$table->string('comment')->default('');
$table->bigInteger('first')->default(0);
$table->bigInteger('last')->default(0);
$table->index(['first', 'last'], 'first_last');
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::dropIfExists('bans');
}
}