fix migration errors

This commit is contained in:
Mohit Panjwani
2020-05-13 12:47:06 +05:30
parent c7ce8c87dd
commit 4ca574c581
2 changed files with 18 additions and 14 deletions

View File

@ -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();
});
}
}
/**

View File

@ -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();
});
}
}
/**