| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- <?php
- namespace app\migrations;
- use yii\db\Migration;
- /**
- * Class M231025180521AddTableBackendUnreadCount
- */
- class M231025180521AddTableBackendUnreadCount extends Migration
- {
- /**
- * {@inheritdoc}
- */
- public function safeUp()
- {
- try {
- $sql = <<<SQL
- CREATE TABLE `qimall_backend_unread_count` (
- `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
- `mall_id` int(10) DEFAULT '0' COMMENT '商城ID',
- `type` int(10) DEFAULT '0' COMMENT '项目类型[1=订单,2=售后订单,3=提现,4=通知]',
- `unread_num` int(10) DEFAULT '0' COMMENT '未读总数',
- `status` tinyint(1) NOT NULL DEFAULT '1' COMMENT '状态[-1:删除;0:禁用;1启用]',
- `created_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '添加时间戳',
- `updated_at` int(11) unsigned NOT NULL DEFAULT '0' COMMENT '更新时间戳',
- PRIMARY KEY (`id`) USING BTREE,
- KEY `mall_id` (`mall_id`) USING BTREE
- ) ENGINE=InnoDB AUTO_INCREMENT=1 DEFAULT CHARSET=utf8mb4 ROW_FORMAT=DYNAMIC COMMENT='后台未读统计表';
- SQL;
- $this->execute($sql);
- } catch (\Exception $e) {
- }
- }
- /**
- * {@inheritdoc}
- */
- public function safeDown()
- {
- echo "M231025180521AddTableBackendUnreadCount cannot be reverted.\n";
- return false;
- }
- }
|