Check table before creating

This commit is contained in:
Pig Fang 2019-04-19 23:05:58 +08:00
parent 228c2df73e
commit ff4fa1eefa

View File

@ -8,15 +8,17 @@ class CreateReportTable extends Migration
{ {
public function up() public function up()
{ {
Schema::create('reports', function (Blueprint $table) { if (! Schema::hasTable('reports')) {
$table->increments('id'); Schema::create('reports', function (Blueprint $table) {
$table->integer('tid'); $table->increments('id');
$table->integer('uploader'); $table->integer('tid');
$table->integer('reporter'); $table->integer('uploader');
$table->longText('reason'); $table->integer('reporter');
$table->integer('status'); $table->longText('reason');
$table->dateTime('report_at'); $table->integer('status');
}); $table->dateTime('report_at');
});
}
} }
public function down() public function down()