Include ID in Supplier Account Sync and add supplier id integrity constraint

This commit is contained in:
Deon George 2022-08-11 11:03:36 +10:00
parent f5d535daa7
commit 70571cb6ac
2 changed files with 33 additions and 1 deletions

View File

@ -60,7 +60,7 @@ class SupplierAccountSync extends Command
} }
} else { } else {
$this->error(sprintf('User doesnt exist with email (%s)',$customer->email)); $this->error(sprintf('User doesnt exist with email (%s:%s)',$customer->id,$customer->email));
} }
} }
} }

View File

@ -0,0 +1,32 @@
<?php
use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;
return new class extends Migration
{
/**
* Run the migrations.
*
* @return void
*/
public function up()
{
Schema::table('supplier_user', function (Blueprint $table) {
$table->unique(['supplier_id','id']);
});
}
/**
* Reverse the migrations.
*
* @return void
*/
public function down()
{
Schema::table('supplier_user', function (Blueprint $table) {
$table->dropUnique(['supplier_id','id']);
});
}
};