A free open source IT asset/license management system
Add migration for postgres
Marcus Moore990358750b70
diff --git a/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php b/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.phpindex aadceebc88..7be7e155d8 100644--- a/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php+++ b/database/migrations/2023_07_13_052204_denormalized_eol_and_add_column_for_explicit_date_to_assets.php@@ -75,7 +75,11 @@ class DenormalizedEolAndAddColumnForExplicitDateToAssets extends Migrationprivate function eolUpdateExpression(): Expression{if (DB::getDriverName() === 'sqlite') {- return DB::raw("DATE(purchase_date, '+' || (SELECT eol FROM " . DB::getTablePrefix() ."models WHERE models.id = assets.model_id) || ' months')");+ return DB::raw("DATE(purchase_date, '+' || (SELECT eol FROM " . DB::getTablePrefix() . "models WHERE models.id = assets.model_id) || ' months')");+ }++ if (DB::getDriverName() === 'pgsql') {+ return DB::raw("date(purchase_date + interval '1 month' * (SELECT eol FROM " . DB::getTablePrefix() . "models WHERE models.id = assets.model_id))");}// Default to MySQL's method