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,6 +8,7 @@ class CreateReportTable extends Migration
{ {
public function up() public function up()
{ {
if (! Schema::hasTable('reports')) {
Schema::create('reports', function (Blueprint $table) { Schema::create('reports', function (Blueprint $table) {
$table->increments('id'); $table->increments('id');
$table->integer('tid'); $table->integer('tid');
@ -18,6 +19,7 @@ class CreateReportTable extends Migration
$table->dateTime('report_at'); $table->dateTime('report_at');
}); });
} }
}
public function down() public function down()
{ {