diff --git a/database/migrations/2017_04_11_064308_create_units_table.php b/database/migrations/2017_04_11_064308_create_units_table.php index 0cc1cb91..5b14a3b6 100644 --- a/database/migrations/2017_04_11_064308_create_units_table.php +++ b/database/migrations/2017_04_11_064308_create_units_table.php @@ -13,13 +13,15 @@ class CreateUnitsTable extends Migration */ public function up() { - Schema::create('units', function (Blueprint $table) { - $table->increments('id'); - $table->string('name'); - $table->integer('company_id')->unsigned()->nullable(); - $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade'); - $table->timestamps(); - }); + if (!Schema::hasTable('units')) { + Schema::create('units', function (Blueprint $table) { + $table->increments('id'); + $table->string('name'); + $table->integer('company_id')->unsigned()->nullable(); + $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade'); + $table->timestamps(); + }); + } } /** diff --git a/database/migrations/2019_09_02_053155_create_payment_methods_table.php b/database/migrations/2019_09_02_053155_create_payment_methods_table.php index 8880c6a4..8a2c7caf 100644 --- a/database/migrations/2019_09_02_053155_create_payment_methods_table.php +++ b/database/migrations/2019_09_02_053155_create_payment_methods_table.php @@ -13,13 +13,15 @@ class CreatePaymentMethodsTable extends Migration */ public function up() { - Schema::create('payment_methods', function (Blueprint $table) { - $table->increments('id'); - $table->string('name'); - $table->integer('company_id')->unsigned()->nullable(); - $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade'); - $table->timestamps(); - }); + if (!Schema::hasTable('payment_methods')) { + Schema::create('payment_methods', function (Blueprint $table) { + $table->increments('id'); + $table->string('name'); + $table->integer('company_id')->unsigned()->nullable(); + $table->foreign('company_id')->references('id')->on('companies')->onDelete('cascade'); + $table->timestamps(); + }); + } } /**