diff --git a/database/migrations/2026_10_05_100000_widen_product_monthly_weighted_average_precision.php b/database/migrations/2026_10_05_100000_widen_product_monthly_weighted_average_precision.php new file mode 100644 index 00000000..9b67c2c5 --- /dev/null +++ b/database/migrations/2026_10_05_100000_widen_product_monthly_weighted_average_precision.php @@ -0,0 +1,33 @@ +hasTable('product_monthly_weighted_average_rows')) { + return; + } + + foreach (self::COLUMNS as $column) { + DB::connection($connection)->statement( + "alter table `product_monthly_weighted_average_rows` modify `{$column}` decimal(24,8) null", + ); + } + } + + public function down(): void + { + // 缩放回 4 位会丢失精度,这里保持不回退。 + } +};