fix: Updated Migration to calculate hourly price from existing products

This commit is contained in:
IceToast 2022-06-16 11:55:34 +02:00
parent 8f38b9e023
commit 950278c948

View file

@ -19,6 +19,14 @@ class AddBillingPeriodToProducts extends Migration
});
DB::statement('UPDATE products SET billing_period="hourly"');
$products = DB::table('products')->get();
foreach ($products as $product) {
$price = $product->price;
$price = $price / 30 / 24;
DB::table('products')->where('id', $product->id)->update(['price' => $price]);
}
}
/**