snipe-it/database/migrations/2018_10_19_153910_add_kits_table.php
snipe 86a2312a31 Check if table exists before trying to create
Signed-off-by: snipe <snipe@snipe.net>
2022-03-07 20:13:10 -08:00

40 lines
611 B
PHP

<?php
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
class AddKitsTable extends Migration {
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
if (!Schema::hasTable('kits')) {
Schema::create('kits', function ($table) {
$table->increments('id');
$table->string('name')->nullable()->default(NULL);
$table->timestamps();
$table->engine = 'InnoDB';
});
}
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
if (Schema::hasTable('kits')) {
Schema::drop('kits');
}
}
}