Handle lastSeen column and all the discontinued items.

This commit was merged in pull request #35.
This commit is contained in:
2026-01-10 08:56:31 +01:00
parent 914310dab8
commit 7920172735
6 changed files with 28 additions and 11 deletions

View File

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