From a6709b275f7bf654eff78d4879f7eb871ccf2491 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=82=B9=E6=99=AF=E7=AB=8B?= Date: Thu, 13 Oct 2022 17:06:59 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=95=B0=E6=8D=AE=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../migrations/20221013045835_wechat_news_article.php | 9 +++++---- .../migrations/20221013045836_base_postage_company.php | 2 +- .../migrations/20221013045837_base_postage_region.php | 2 +- .../migrations/20221013070248_data_user_transfer.php | 5 ++++- database/migrations/20221013074937_data_user_token.php | 5 ++++- database/migrations/20221013075147_data_user_rebate.php | 5 ++++- database/migrations/20221013075303_data_user_payment.php | 5 ++++- database/migrations/20221013075425_data_user_message.php | 5 ++++- database/migrations/20221013075532_data_user_balance.php | 5 ++++- database/migrations/20221013075634_data_user_address.php | 5 ++++- database/migrations/20221013075731_data_user.php | 5 ++++- .../migrations/20221013075924_data_newsx_collect.php | 5 ++++- database/migrations/20221013080029_data_news_mark.php | 5 ++++- database/migrations/20221013080123_data_news_item.php | 5 ++++- database/migrations/20221013080600_shop_goods.php | 3 +++ database/migrations/20221013080650_shop_goods_cate.php | 5 ++++- database/migrations/20221013080732_shop_goods_item.php | 5 ++++- database/migrations/20221013080838_shop_goods_mark.php | 5 ++++- database/migrations/20221013080943_shop_goods_stock.php | 5 ++++- database/migrations/20221013081028_shop_order.php | 5 ++++- database/migrations/20221013081138_shop_order_item.php | 5 ++++- database/migrations/20221013081214_shop_order_send.php | 5 ++++- 22 files changed, 82 insertions(+), 24 deletions(-) diff --git a/database/migrations/20221013045835_wechat_news_article.php b/database/migrations/20221013045835_wechat_news_article.php index ff3d97218..e3b051486 100644 --- a/database/migrations/20221013045835_wechat_news_article.php +++ b/database/migrations/20221013045835_wechat_news_article.php @@ -7,16 +7,17 @@ use think\migration\Migrator; */ class WechatNewsArticle extends Migrator { - private $name = 'wechat_news_article'; - public function change() { + // 当前操作 + $table = 'wechat_news_article'; + // 存在则跳过 - if ($this->hasTable($this->name)) { + if ($this->hasTable($table)) { return; } // 创建数据表 - $this->table($this->name, [ + $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-文章', ]) ->addColumn('title', 'string', ['limit' => 100, 'default' => '', 'comment' => '素材标题']) diff --git a/database/migrations/20221013045836_base_postage_company.php b/database/migrations/20221013045836_base_postage_company.php index 9f486fd83..43fe2909e 100644 --- a/database/migrations/20221013045836_base_postage_company.php +++ b/database/migrations/20221013045836_base_postage_company.php @@ -19,7 +19,7 @@ class BasePostageCompany extends Migrator // 创建数据表 $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '', + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-快递-公司', ]) ->addColumn('name', 'string', ['limit' => 50, 'default' => '', 'comment' => '快递公司名称']) ->addColumn('code_1', 'string', ['limit' => 50, 'default' => '', 'comment' => '快递公司代码']) diff --git a/database/migrations/20221013045837_base_postage_region.php b/database/migrations/20221013045837_base_postage_region.php index 3e22cd0ac..08c0a77f1 100644 --- a/database/migrations/20221013045837_base_postage_region.php +++ b/database/migrations/20221013045837_base_postage_region.php @@ -19,7 +19,7 @@ class BasePostageRegion extends Migrator // 创建数据表 $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '', + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-快递-区域', ]) ->addColumn('pid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '上级PID']) ->addColumn('first', 'string', ['limit' => 50, 'default' => '', 'comment' => '首字母']) diff --git a/database/migrations/20221013070248_data_user_transfer.php b/database/migrations/20221013070248_data_user_transfer.php index 22d3c9d88..2886f7557 100644 --- a/database/migrations/20221013070248_data_user_transfer.php +++ b/database/migrations/20221013070248_data_user_transfer.php @@ -2,6 +2,9 @@ use think\migration\Migrator; +/** + * 前端用户提现数据 + */ class DataUserTransfer extends Migrator { public function change() @@ -15,7 +18,7 @@ class DataUserTransfer extends Migrator // 创建数据表 $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '', + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-用户-提现', ]) ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '用户UID']) ->addColumn('type', 'string', ['limit' => 30, 'default' => '', 'comment' => '提现方式']) diff --git a/database/migrations/20221013074937_data_user_token.php b/database/migrations/20221013074937_data_user_token.php index 2f4f050e3..c06a1baf5 100644 --- a/database/migrations/20221013074937_data_user_token.php +++ b/database/migrations/20221013074937_data_user_token.php @@ -2,6 +2,9 @@ use think\migration\Migrator; +/** + * 前端用户授权数据 + */ class DataUserToken extends Migrator { public function change() @@ -16,7 +19,7 @@ class DataUserToken extends Migrator // 创建数据表 $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '', + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-用户-认证', ]) ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '用户UID']) ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'comment' => '授权类型']) diff --git a/database/migrations/20221013075147_data_user_rebate.php b/database/migrations/20221013075147_data_user_rebate.php index 1e1e3bff0..4e127dbb1 100644 --- a/database/migrations/20221013075147_data_user_rebate.php +++ b/database/migrations/20221013075147_data_user_rebate.php @@ -2,6 +2,9 @@ use think\migration\Migrator; +/** + * 前端用户返利数据 + */ class DataUserRebate extends Migrator { public function change() @@ -16,7 +19,7 @@ class DataUserRebate extends Migrator // 创建数据表 $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '', + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-用户-返利', ]) ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '用户UID']) ->addColumn('date', 'string', ['limit' => 20, 'default' => '', 'comment' => '奖励日期']) diff --git a/database/migrations/20221013075303_data_user_payment.php b/database/migrations/20221013075303_data_user_payment.php index e958952bc..eaa285490 100644 --- a/database/migrations/20221013075303_data_user_payment.php +++ b/database/migrations/20221013075303_data_user_payment.php @@ -2,6 +2,9 @@ use think\migration\Migrator; +/** + * 用户支付行为数据 + */ class DataUserPayment extends Migrator { public function change() @@ -16,7 +19,7 @@ class DataUserPayment extends Migrator // 创建数据表 $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '', + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-用户-支付', ]) ->addColumn('order_no', 'string', ['limit' => 20, 'default' => '', 'comment' => '订单单号']) ->addColumn('order_name', 'string', ['limit' => 255, 'default' => '', 'comment' => '订单描述']) diff --git a/database/migrations/20221013075425_data_user_message.php b/database/migrations/20221013075425_data_user_message.php index 5f1327b55..6c385ae60 100644 --- a/database/migrations/20221013075425_data_user_message.php +++ b/database/migrations/20221013075425_data_user_message.php @@ -2,6 +2,9 @@ use think\migration\Migrator; +/** + * 前端用户短信数据 + */ class DataUserMessage extends Migrator { public function change() @@ -16,7 +19,7 @@ class DataUserMessage extends Migrator // 创建数据表 $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '', + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-用户-短信', ]) ->addColumn('type', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '短信类型']) ->addColumn('msgid', 'string', ['limit' => 50, 'default' => '', 'comment' => '消息编号']) diff --git a/database/migrations/20221013075532_data_user_balance.php b/database/migrations/20221013075532_data_user_balance.php index 3a62b4b2f..20034c490 100644 --- a/database/migrations/20221013075532_data_user_balance.php +++ b/database/migrations/20221013075532_data_user_balance.php @@ -2,6 +2,9 @@ use think\migration\Migrator; +/** + * 前端用户余额数据 + */ class DataUserBalance extends Migrator { public function change() @@ -16,7 +19,7 @@ class DataUserBalance extends Migrator // 创建数据表 $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '', + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-用户-余额', ]) ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '用户UID']) ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'comment' => '充值编号']) diff --git a/database/migrations/20221013075634_data_user_address.php b/database/migrations/20221013075634_data_user_address.php index f088cabab..99b451a2a 100644 --- a/database/migrations/20221013075634_data_user_address.php +++ b/database/migrations/20221013075634_data_user_address.php @@ -2,6 +2,9 @@ use think\migration\Migrator; +/** + * 前端用户收货地址数据 + */ class DataUserAddress extends Migrator { public function change() @@ -16,7 +19,7 @@ class DataUserAddress extends Migrator // 创建数据表 $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '', + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-用户-收货地址', ]) ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '用户UID']) ->addColumn('type', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '地址类型(0普通,1默认)']) diff --git a/database/migrations/20221013075731_data_user.php b/database/migrations/20221013075731_data_user.php index eb28bfb6f..86726392b 100644 --- a/database/migrations/20221013075731_data_user.php +++ b/database/migrations/20221013075731_data_user.php @@ -2,6 +2,9 @@ use think\migration\Migrator; +/** + * 前端用户数据 + */ class DataUser extends Migrator { public function change() @@ -16,7 +19,7 @@ class DataUser extends Migrator // 创建数据表 $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '', + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-用户', ]) ->addColumn('pid0', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '临时推荐人UID']) ->addColumn('pid1', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '推荐人一级UID']) diff --git a/database/migrations/20221013075924_data_newsx_collect.php b/database/migrations/20221013075924_data_newsx_collect.php index 18c3e0d5a..391ffc05d 100644 --- a/database/migrations/20221013075924_data_newsx_collect.php +++ b/database/migrations/20221013075924_data_newsx_collect.php @@ -2,6 +2,9 @@ use think\migration\Migrator; +/** + * 文章用户数据 + */ class DataNewsxCollect extends Migrator { public function change() @@ -16,7 +19,7 @@ class DataNewsxCollect extends Migrator // 创建数据表 $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '', + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-文章-交互', ]) ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '用户UID']) ->addColumn('type', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '记录类型(1收藏,2点赞,3历史,4评论)']) diff --git a/database/migrations/20221013080029_data_news_mark.php b/database/migrations/20221013080029_data_news_mark.php index d407c367b..25301e4a6 100644 --- a/database/migrations/20221013080029_data_news_mark.php +++ b/database/migrations/20221013080029_data_news_mark.php @@ -2,6 +2,9 @@ use think\migration\Migrator; +/** + * 文章标签数据 + */ class DataNewsMark extends Migrator { public function change() @@ -16,7 +19,7 @@ class DataNewsMark extends Migrator // 创建数据表 $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '', + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-文章-标签', ]) ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'comment' => '标签名称']) ->addColumn('remark', 'string', ['limit' => 500, 'default' => '', 'comment' => '标签说明']) diff --git a/database/migrations/20221013080123_data_news_item.php b/database/migrations/20221013080123_data_news_item.php index ecac712f8..24e34ee17 100644 --- a/database/migrations/20221013080123_data_news_item.php +++ b/database/migrations/20221013080123_data_news_item.php @@ -2,6 +2,9 @@ use think\migration\Migrator; +/** + * 文章主体数据 + */ class DataNewsItem extends Migrator { public function change() @@ -16,7 +19,7 @@ class DataNewsItem extends Migrator // 创建数据表 $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '', + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-文章', ]) ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'comment' => '文章编号']) ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'comment' => '文章标题']) diff --git a/database/migrations/20221013080600_shop_goods.php b/database/migrations/20221013080600_shop_goods.php index 9534a5652..d4ad8d464 100644 --- a/database/migrations/20221013080600_shop_goods.php +++ b/database/migrations/20221013080600_shop_goods.php @@ -2,6 +2,9 @@ use think\migration\Migrator; +/** + * 商品主体数据 + */ class ShopGoods extends Migrator { public function change() diff --git a/database/migrations/20221013080650_shop_goods_cate.php b/database/migrations/20221013080650_shop_goods_cate.php index 6304a0d5a..f56df479a 100644 --- a/database/migrations/20221013080650_shop_goods_cate.php +++ b/database/migrations/20221013080650_shop_goods_cate.php @@ -2,6 +2,9 @@ use think\migration\Migrator; +/** + * 商品分类数据 + */ class ShopGoodsCate extends Migrator { public function change() @@ -16,7 +19,7 @@ class ShopGoodsCate extends Migrator // 创建数据表 $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '', + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-商品-分类', ]) ->addColumn('pid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '上级分类']) ->addColumn('name', 'string', ['limit' => 255, 'default' => '', 'comment' => '分类名称']) diff --git a/database/migrations/20221013080732_shop_goods_item.php b/database/migrations/20221013080732_shop_goods_item.php index 47eac891f..dddbb95e0 100644 --- a/database/migrations/20221013080732_shop_goods_item.php +++ b/database/migrations/20221013080732_shop_goods_item.php @@ -2,6 +2,9 @@ use think\migration\Migrator; +/** + * 商品规格数据 + */ class ShopGoodsItem extends Migrator { public function change() @@ -16,7 +19,7 @@ class ShopGoodsItem extends Migrator // 创建数据表 $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '', + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-商品-规格', ]) ->addColumn('goods_sku', 'string', ['limit' => 20, 'default' => '', 'comment' => '商品SKU']) ->addColumn('goods_code', 'string', ['limit' => 20, 'default' => '', 'comment' => '商品编号']) diff --git a/database/migrations/20221013080838_shop_goods_mark.php b/database/migrations/20221013080838_shop_goods_mark.php index eea6c1fa2..3457d9ce9 100644 --- a/database/migrations/20221013080838_shop_goods_mark.php +++ b/database/migrations/20221013080838_shop_goods_mark.php @@ -2,6 +2,9 @@ use think\migration\Migrator; +/** + * 商品标签数据 + */ class ShopGoodsMark extends Migrator { public function change() @@ -16,7 +19,7 @@ class ShopGoodsMark extends Migrator // 创建数据表 $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '', + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-商品-标签', ]) ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'comment' => '标签名称']) ->addColumn('remark', 'string', ['limit' => 200, 'default' => '', 'comment' => '标签描述']) diff --git a/database/migrations/20221013080943_shop_goods_stock.php b/database/migrations/20221013080943_shop_goods_stock.php index 449e2babf..388cf937b 100644 --- a/database/migrations/20221013080943_shop_goods_stock.php +++ b/database/migrations/20221013080943_shop_goods_stock.php @@ -2,6 +2,9 @@ use think\migration\Migrator; +/** + * 商品库存 + */ class ShopGoodsStock extends Migrator { public function change() @@ -16,7 +19,7 @@ class ShopGoodsStock extends Migrator // 创建数据表 $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '', + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-商品-库存', ]) ->addColumn('batch_no', 'string', ['limit' => 20, 'default' => '', 'comment' => '操作批量']) ->addColumn('goods_code', 'string', ['limit' => 20, 'default' => '', 'comment' => '商品编号']) diff --git a/database/migrations/20221013081028_shop_order.php b/database/migrations/20221013081028_shop_order.php index 1da77a04d..01c8414b7 100644 --- a/database/migrations/20221013081028_shop_order.php +++ b/database/migrations/20221013081028_shop_order.php @@ -2,6 +2,9 @@ use think\migration\Migrator; +/** + * 订单主体数据 + */ class ShopOrder extends Migrator { public function change() @@ -16,7 +19,7 @@ class ShopOrder extends Migrator // 创建数据表 $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '', + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-订单', ]) ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '下单用户编号']) ->addColumn('puid1', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '推荐一层用户']) diff --git a/database/migrations/20221013081138_shop_order_item.php b/database/migrations/20221013081138_shop_order_item.php index 005b1bb0e..7c0085f0e 100644 --- a/database/migrations/20221013081138_shop_order_item.php +++ b/database/migrations/20221013081138_shop_order_item.php @@ -2,6 +2,9 @@ use think\migration\Migrator; +/** + * 订单商品数据 + */ class ShopOrderItem extends Migrator { public function change() @@ -16,7 +19,7 @@ class ShopOrderItem extends Migrator // 创建数据表 $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '', + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-订单-商品', ]) ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '商城用户编号']) ->addColumn('order_no', 'string', ['limit' => 20, 'default' => '', 'comment' => '商城订单单号']) diff --git a/database/migrations/20221013081214_shop_order_send.php b/database/migrations/20221013081214_shop_order_send.php index a32ebc532..185a26ef8 100644 --- a/database/migrations/20221013081214_shop_order_send.php +++ b/database/migrations/20221013081214_shop_order_send.php @@ -2,6 +2,9 @@ use think\migration\Migrator; +/** + * 订单发货数据 + */ class ShopOrderSend extends Migrator { public function change() @@ -17,7 +20,7 @@ class ShopOrderSend extends Migrator // 创建数据表 $this->table($table, [ - 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '', + 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-订单-发货', ]) ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '商城用户编号']) ->addColumn('order_no', 'string', ['limit' => 20, 'default' => '', 'comment' => '商城订单单号'])