diff --git a/backend/modules/shop/migrations/m191205_092426_drop_columns_province_city_area_basic_price_basic_count_extra_count_extra_price_in_table_ats_express_template.php b/backend/modules/shop/migrations/m191205_092426_drop_columns_province_city_area_basic_price_basic_count_extra_count_extra_price_in_table_ats_express_template.php new file mode 100644 index 0000000..a0859df --- /dev/null +++ b/backend/modules/shop/migrations/m191205_092426_drop_columns_province_city_area_basic_price_basic_count_extra_count_extra_price_in_table_ats_express_template.php @@ -0,0 +1,32 @@ +dropColumn('ats_express_template', 'province'); + $this->dropColumn('ats_express_template', 'city'); + $this->dropColumn('ats_express_template', 'area'); + $this->dropColumn('ats_express_template', 'extra_price'); + $this->dropColumn('ats_express_template', 'basic_price'); + $this->dropColumn('ats_express_template', 'basic_count'); + $this->dropColumn('ats_express_template', 'extra_count'); + } + + public function down() + { + $this->addColumn('ats_express_template', 'province', $this->text()->comment('省份')); + $this->addColumn('ats_express_template', 'city', $this->text()->comment('城市')); + $this->addColumn('ats_express_template', 'area', $this->text()->comment('区域')); + $this->addColumn('ats_express_template', 'extra_price', $this->integer(20)->defaultValue(null)->comment('续重运费')); + $this->addColumn('ats_express_template', 'basic_price', $this->integer(20)->defaultValue(null)->comment('基本运费')); + $this->addColumn('ats_express_template', 'basic_count', $this->integer(20)->defaultValue(null)->comment('基本数量')); + $this->addColumn('ats_express_template', 'extra_count', $this->integer(20)->defaultValue(null)->comment('续重数量')); + return true; + } +} diff --git a/backend/modules/shop/migrations/m191205_092942_create_table_ats_express_area.php b/backend/modules/shop/migrations/m191205_092942_create_table_ats_express_area.php new file mode 100644 index 0000000..bd50a85 --- /dev/null +++ b/backend/modules/shop/migrations/m191205_092942_create_table_ats_express_area.php @@ -0,0 +1,36 @@ +createTable('ats_express_area', [ + 'id' => $this->primaryKey(), + 'province' => $this->text()->comment('省份'), + 'city' => $this->text()->comment('城市'), + 'area' => $this->text()->comment('区域'), + 'express_template' => $this->integer(11)->defaultValue(null)->comment('运费模板id'), + 'extra_price' => $this->integer(20)->defaultValue(null)->comment('续重运费'), + 'basic_price' => $this->integer(20)->defaultValue(null)->comment('基本运费'), + 'basic_count' => $this->integer(20)->defaultValue(null)->comment('基本数量'), + 'extra_count' => $this->integer(20)->defaultValue(null)->comment('续重数量'), + 'updated_at'=>$this->integer(11)->defaultValue(null)->comment('更新时间'), + 'created_at'=>$this->integer(11)->defaultValue(null)->comment('创建时间'), + ],$tableOptions); + } + + /** + * {@inheritdoc} + */ + public function down() + { + $this->dropTable('ats_express_area'); + return true; + } +}