diff --git a/database/migrations/2021_12_22_152013_add_growth_value_to_product_spus_table.php b/database/migrations/2021_12_22_152013_add_sales_value_to_product_spus_table.php similarity index 71% rename from database/migrations/2021_12_22_152013_add_growth_value_to_product_spus_table.php rename to database/migrations/2021_12_22_152013_add_sales_value_to_product_spus_table.php index 463ee9b3..044d5808 100644 --- a/database/migrations/2021_12_22_152013_add_growth_value_to_product_spus_table.php +++ b/database/migrations/2021_12_22_152013_add_sales_value_to_product_spus_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class AddGrowthValueToProductSpusTable extends Migration +class AddSalesValueToProductSpusTable extends Migration { /** * Run the migrations. @@ -14,8 +14,7 @@ class AddGrowthValueToProductSpusTable extends Migration public function up() { Schema::table('product_spus', function (Blueprint $table) { - // - $table->unsignedBigInteger('growth_value')->default(0)->comment('等级成长值'); + $table->unsignedDecimal('sales_value', 18, 2)->default(0.00)->comment('销售值'); }); } @@ -28,7 +27,7 @@ class AddGrowthValueToProductSpusTable extends Migration { Schema::table('product_spus', function (Blueprint $table) { // - $table->dropColumn('product_spus'); + $table->dropColumn(['sales_value']); }); } } diff --git a/database/migrations/2021_12_22_152034_add_growth_value_to_product_skus_table.php b/database/migrations/2021_12_22_152034_add_sales_value_to_product_skus_table.php similarity index 71% rename from database/migrations/2021_12_22_152034_add_growth_value_to_product_skus_table.php rename to database/migrations/2021_12_22_152034_add_sales_value_to_product_skus_table.php index 586eb8ca..2bbbf449 100644 --- a/database/migrations/2021_12_22_152034_add_growth_value_to_product_skus_table.php +++ b/database/migrations/2021_12_22_152034_add_sales_value_to_product_skus_table.php @@ -4,7 +4,7 @@ use Illuminate\Database\Migrations\Migration; use Illuminate\Database\Schema\Blueprint; use Illuminate\Support\Facades\Schema; -class AddGrowthValueToProductSkusTable extends Migration +class AddSalesValueToProductSkusTable extends Migration { /** * Run the migrations. @@ -14,8 +14,7 @@ class AddGrowthValueToProductSkusTable extends Migration public function up() { Schema::table('product_skus', function (Blueprint $table) { - // - $table->unsignedBigInteger('growth_value')->default(0)->comment('等级成长值'); + $table->unsignedDecimal('sales_value', 18, 2)->default(0.00)->comment('销售值'); }); } @@ -28,7 +27,7 @@ class AddGrowthValueToProductSkusTable extends Migration { Schema::table('product_skus', function (Blueprint $table) { // - $table->dropColumn('product_skus'); + $table->dropColumn(['sales_value']); }); } } diff --git a/database/migrations/2021_12_23_113617_add_sales_value_to_order_products_table.php b/database/migrations/2021_12_23_113617_add_sales_value_to_order_products_table.php new file mode 100644 index 00000000..00ed6157 --- /dev/null +++ b/database/migrations/2021_12_23_113617_add_sales_value_to_order_products_table.php @@ -0,0 +1,32 @@ +unsignedDecimal('sales_value', 18, 2)->default(0.00)->comment('销售值'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('order_products', function (Blueprint $table) { + $table->dropColumn(['sales_value']); + }); + } +} diff --git a/database/migrations/2021_12_23_115137_add_sales_value_to_orders_table.php b/database/migrations/2021_12_23_115137_add_sales_value_to_orders_table.php new file mode 100644 index 00000000..e376f99f --- /dev/null +++ b/database/migrations/2021_12_23_115137_add_sales_value_to_orders_table.php @@ -0,0 +1,32 @@ +unsignedDecimal('sales_value', 18, 2)->default(0.00)->comment('总销售值'); + }); + } + + /** + * Reverse the migrations. + * + * @return void + */ + public function down() + { + Schema::table('orders', function (Blueprint $table) { + $table->dropColumn(['sales_value']); + }); + } +}