Fixes for CI/CD

This commit is contained in:
Deon George
2022-02-01 20:15:11 +11:00
parent b9b4416737
commit d1a7e399dc
9 changed files with 27 additions and 32 deletions

View File

@@ -13,6 +13,8 @@ class OptimizeProduct extends Migration
*/
public function up()
{
$site = \App\Models\Site::where('site_id',1)->firstOrNew();
Schema::table('ab_product', function (Blueprint $table) {
$table->dropForeign(['site_id']);
$table->dropIndex(['id','site_id']);
@@ -490,6 +492,10 @@ class OptimizeProduct extends Migration
}
}
// No need to update tables, if we dont have a site setup yet.
if (! $site->exists)
return;
// SSL
$so = \App\Models\Supplier::where('name','Graytech Hosting Pty Ltd')->firstOrNew();
$so->name = 'Graytech Hosting Pty Ltd';
@@ -500,7 +506,7 @@ class OptimizeProduct extends Migration
->where('site_id','1')
->where('supplier_id',$so->id)
->firstOrNew();
$sdo->site_id = 1;
$sdo->site_id = $site->site_id;
$so->detail()->save($sdo);
$o = new \App\Models\Supplier\SSL;
@@ -538,7 +544,7 @@ class OptimizeProduct extends Migration
->where('site_id','1')
->where('supplier_id',$so->id)
->firstOrNew();
$sdo->site_id = 1;
$sdo->site_id = $site->site_id;
$so->detail()->save($sdo);
$o = new \App\Models\Supplier\Host;
@@ -561,7 +567,7 @@ class OptimizeProduct extends Migration
->where('site_id','1')
->where('supplier_id',$so->id)
->firstOrNew();
$sdo->site_id = 1;
$sdo->site_id = $site->site_id;
$so->detail()->save($sdo);
$o = new \App\Models\Supplier\Voip;