Handle lastSeen column and all the discontinued items.
This commit was merged in pull request #35.
This commit is contained in:
@@ -38,7 +38,7 @@ class Migrate extends Command
|
||||
$this->createProductsTable();
|
||||
$this->createPricesTable();
|
||||
$this->createStocksTable();
|
||||
$this->updateProductsTableAddPrices();
|
||||
$this->addColumns();
|
||||
|
||||
return Command::SUCCESS;
|
||||
}
|
||||
@@ -95,7 +95,7 @@ class Migrate extends Command
|
||||
}
|
||||
}
|
||||
|
||||
public function updateProductsTableAddPrices(): void
|
||||
public function addColumns(): void
|
||||
{
|
||||
if (!Capsule::schema()->hasColumn('products', 'priceCurrent')) {
|
||||
Capsule::schema()->table('products', function (Blueprint $table) {
|
||||
@@ -120,5 +120,11 @@ class Migrate extends Command
|
||||
$table->float('lowestProductPrice30Days')->default(0);
|
||||
});
|
||||
}
|
||||
|
||||
if (!Capsule::schema()->hasColumn('products', 'lastSeen')) {
|
||||
Capsule::schema()->table('products', function (Blueprint $table) {
|
||||
$table->date('last_seen')->nullable();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user