diff --git a/app/admin/database/20221013031925_install_admin.php b/app/admin/database/20221013031925_install_admin.php index 134a85c86..77473401e 100644 --- a/app/admin/database/20221013031925_install_admin.php +++ b/app/admin/database/20221013031925_install_admin.php @@ -40,12 +40,12 @@ class InstallAdmin extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-权限', ]) - ->addColumn('title', 'string', ['limit' => 100, 'default' => '', 'comment' => '权限名称']) - ->addColumn('utype', 'string', ['limit' => 50, 'default' => '', 'comment' => '身份权限']) - ->addColumn('desc', 'string', ['limit' => 500, 'default' => '', 'comment' => '备注说明']) - ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '排序权重']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '权限状态(1使用,0禁用)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('title', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '权限名称']) + ->addColumn('utype', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '身份权限']) + ->addColumn('desc', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '备注说明']) + ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '权限状态(1使用,0禁用)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('status', ['name' => 'idx_system_auth_status']) ->addIndex('title', ['name' => 'idx_system_auth_title']) ->save(); @@ -73,8 +73,8 @@ class InstallAdmin extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-授权', ]) - ->addColumn('auth', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '角色']) - ->addColumn('node', 'string', ['limit' => 200, 'default' => '', 'comment' => '节点']) + ->addColumn('auth', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '角色']) + ->addColumn('node', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '节点']) ->addIndex('auth', ['name' => 'idx_system_auth_node_auth']) ->addIndex('node', ['name' => 'idx_system_auth_node_node']) ->save(); @@ -102,16 +102,16 @@ class InstallAdmin extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-字典', ]) - ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'comment' => '数据类型']) - ->addColumn('code', 'string', ['limit' => 100, 'default' => '', 'comment' => '数据代码']) - ->addColumn('name', 'string', ['limit' => 500, 'default' => '', 'comment' => '数据名称']) - ->addColumn('content', 'text', ['default' => null, 'comment' => '数据内容']) - ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '排序权重']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '数据状态(0禁用,1启动)']) - ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态(0正常,1已删)']) - ->addColumn('deleted_at', 'string', ['limit' => 20, 'default' => '', 'comment' => '删除时间']) - ->addColumn('deleted_by', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '删除用户']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '数据类型']) + ->addColumn('code', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '数据代码']) + ->addColumn('name', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '数据名称']) + ->addColumn('content', 'text', ['default' => null, 'null' => true, 'comment' => '数据内容']) + ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '数据状态(0禁用,1启动)']) + ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0正常,1已删)']) + ->addColumn('deleted_at', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '删除时间']) + ->addColumn('deleted_by', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '删除用户']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('type', ['name' => 'idx_system_base_type']) ->addIndex('code', ['name' => 'idx_system_base_code']) ->addIndex('name', ['name' => 'idx_system_base_name']) @@ -140,9 +140,9 @@ class InstallAdmin extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-配置', ]) - ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'comment' => '配置分类']) - ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'comment' => '配置名称']) - ->addColumn('value', 'string', ['limit' => 2048, 'default' => '', 'comment' => '配置内容']) + ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '配置分类']) + ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '配置名称']) + ->addColumn('value', 'string', ['limit' => 2048, 'default' => '', 'null' => true, 'comment' => '配置内容']) ->addIndex('type', ['name' => 'idx_system_config_type']) ->addIndex('name', ['name' => 'idx_system_config_name']) ->save(); @@ -170,8 +170,8 @@ class InstallAdmin extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-数据', ]) - ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'comment' => '配置名']) - ->addColumn('value', 'text', ['default' => null, 'comment' => '配置值']) + ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '配置名']) + ->addColumn('value', 'text', ['default' => null, 'null' => true, 'comment' => '配置值']) ->addIndex('name', ['name' => 'idx_system_data_name']) ->save(); @@ -198,20 +198,20 @@ class InstallAdmin extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-文件', ]) - ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'comment' => '上传类型']) - ->addColumn('hash', 'string', ['limit' => 32, 'default' => '', 'comment' => '文件哈希']) - ->addColumn('name', 'string', ['limit' => 200, 'default' => '', 'comment' => '文件名称']) - ->addColumn('xext', 'string', ['limit' => 100, 'default' => '', 'comment' => '文件后缀']) - ->addColumn('xurl', 'string', ['limit' => 500, 'default' => '', 'comment' => '访问链接']) - ->addColumn('xkey', 'string', ['limit' => 500, 'default' => '', 'comment' => '文件路径']) - ->addColumn('mime', 'string', ['limit' => 100, 'default' => '', 'comment' => '文件类型']) - ->addColumn('size', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '文件大小']) - ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '用户编号']) - ->addColumn('isfast', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '是否秒传']) - ->addColumn('issafe', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '安全模式']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '上传状态(1悬空,2落地)']) - ->addColumn('create_at', 'datetime', ['default' => null, 'comment' => '创建时间']) - ->addColumn('update_at', 'datetime', ['default' => null, 'comment' => '更新时间']) + ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '上传类型']) + ->addColumn('hash', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '文件哈希']) + ->addColumn('name', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '文件名称']) + ->addColumn('xext', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '文件后缀']) + ->addColumn('xurl', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '访问链接']) + ->addColumn('xkey', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '文件路径']) + ->addColumn('mime', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '文件类型']) + ->addColumn('size', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '文件大小']) + ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户编号']) + ->addColumn('isfast', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '是否秒传']) + ->addColumn('issafe', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '安全模式']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '上传状态(1悬空,2落地)']) + ->addColumn('create_at', 'datetime', ['default' => null, 'null' => true, 'comment' => '创建时间']) + ->addColumn('update_at', 'datetime', ['default' => null, 'null' => true, 'comment' => '更新时间']) ->addIndex('type', ['name' => 'idx_system_file_type']) ->addIndex('hash', ['name' => 'idx_system_file_hash']) ->addIndex('uuid', ['name' => 'idx_system_file_uuid']) @@ -244,16 +244,16 @@ class InstallAdmin extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-菜单', ]) - ->addColumn('pid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '上级ID']) - ->addColumn('title', 'string', ['limit' => 100, 'default' => '', 'comment' => '菜单名称']) - ->addColumn('icon', 'string', ['limit' => 100, 'default' => '', 'comment' => '菜单图标']) - ->addColumn('node', 'string', ['limit' => 100, 'default' => '', 'comment' => '节点代码']) - ->addColumn('url', 'string', ['limit' => 400, 'default' => '', 'comment' => '链接节点']) - ->addColumn('params', 'string', ['limit' => 500, 'default' => '', 'comment' => '链接参数']) - ->addColumn('target', 'string', ['limit' => 20, 'default' => '_self', 'comment' => '打开方式']) - ->addColumn('sort', 'integer', ['limit' => 11, 'default' => 0, 'comment' => '排序权重']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '状态(0:禁用,1:启用)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('pid', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '上级ID']) + ->addColumn('title', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '菜单名称']) + ->addColumn('icon', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '菜单图标']) + ->addColumn('node', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '节点代码']) + ->addColumn('url', 'string', ['limit' => 400, 'default' => '', 'null' => true, 'comment' => '链接节点']) + ->addColumn('params', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '链接参数']) + ->addColumn('target', 'string', ['limit' => 20, 'default' => '_self', 'null' => true, 'comment' => '打开方式']) + ->addColumn('sort', 'integer', ['limit' => 11, 'default' => 0, 'null' => true, 'comment' => '排序权重']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '状态(0:禁用,1:启用)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('status', ['name' => 'idx_system_menu_status']) ->save(); @@ -280,12 +280,12 @@ class InstallAdmin extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-日志', ]) - ->addColumn('node', 'string', ['limit' => 200, 'default' => '', 'comment' => '当前操作节点']) - ->addColumn('geoip', 'string', ['limit' => 15, 'default' => '', 'comment' => '操作者IP地址']) - ->addColumn('action', 'string', ['limit' => 200, 'default' => '', 'comment' => '操作行为名称']) - ->addColumn('content', 'string', ['limit' => 1024, 'default' => '', 'comment' => '操作内容描述']) - ->addColumn('username', 'string', ['limit' => 50, 'default' => '', 'comment' => '操作人用户名']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('node', 'string', ['limit' => 200, 'default' => '', 'null' => false, 'comment' => '当前操作节点']) + ->addColumn('geoip', 'string', ['limit' => 15, 'default' => '', 'null' => false, 'comment' => '操作者IP地址']) + ->addColumn('action', 'string', ['limit' => 200, 'default' => '', 'null' => false, 'comment' => '操作行为名称']) + ->addColumn('content', 'string', ['limit' => 1024, 'default' => '', 'null' => false, 'comment' => '操作内容描述']) + ->addColumn('username', 'string', ['limit' => 50, 'default' => '', 'null' => false, 'comment' => '操作人用户名']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => false, 'comment' => '创建时间']) ->save(); // 修改主键长度 @@ -311,20 +311,20 @@ class InstallAdmin extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-任务', ]) - ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'comment' => '任务编号']) - ->addColumn('title', 'string', ['limit' => 100, 'default' => '', 'comment' => '任务名称']) - ->addColumn('command', 'string', ['limit' => 500, 'default' => '', 'comment' => '执行指令']) - ->addColumn('exec_pid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '执行进程']) - ->addColumn('exec_data', 'text', ['default' => null, 'comment' => '执行参数']) - ->addColumn('exec_time', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '执行时间']) - ->addColumn('exec_desc', 'string', ['limit' => 500, 'default' => '', 'comment' => '执行描述']) - ->addColumn('enter_time', 'decimal', ['precision' => 20, 'scale' => 4, 'default' => '0.0000', 'comment' => '开始时间']) - ->addColumn('outer_time', 'decimal', ['precision' => 20, 'scale' => 4, 'default' => '0.0000', 'comment' => '结束时间']) - ->addColumn('loops_time', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '循环时间']) - ->addColumn('attempts', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '执行次数']) - ->addColumn('rscript', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '任务类型(0单例,1多例)']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '任务状态(1新任务,2处理中,3成功,4失败)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'null' => false, 'comment' => '任务编号']) + ->addColumn('title', 'string', ['limit' => 100, 'default' => '', 'null' => false, 'comment' => '任务名称']) + ->addColumn('command', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '执行指令']) + ->addColumn('exec_pid', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '执行进程']) + ->addColumn('exec_data', 'text', ['default' => null, 'null' => true, 'comment' => '执行参数']) + ->addColumn('exec_time', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '执行时间']) + ->addColumn('exec_desc', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '执行描述']) + ->addColumn('enter_time', 'decimal', ['precision' => 20, 'scale' => 4, 'default' => '0.0000', 'null' => true, 'comment' => '开始时间']) + ->addColumn('outer_time', 'decimal', ['precision' => 20, 'scale' => 4, 'default' => '0.0000', 'null' => true, 'comment' => '结束时间']) + ->addColumn('loops_time', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '循环时间']) + ->addColumn('attempts', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '执行次数']) + ->addColumn('rscript', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '任务类型(0单例,1多例)']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '任务状态(1新任务,2处理中,3成功,4失败)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => false, 'comment' => '创建时间']) ->addIndex('code', ['name' => 'idx_system_queue_code']) ->addIndex('title', ['name' => 'idx_system_queue_title']) ->addIndex('status', ['name' => 'idx_system_queue_status']) @@ -356,23 +356,23 @@ class InstallAdmin extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-用户', ]) - ->addColumn('usertype', 'string', ['limit' => 20, 'default' => '', 'comment' => '用户类型']) - ->addColumn('username', 'string', ['limit' => 50, 'default' => '', 'comment' => '用户账号']) - ->addColumn('password', 'string', ['limit' => 32, 'default' => '', 'comment' => '用户密码']) - ->addColumn('nickname', 'string', ['limit' => 50, 'default' => '', 'comment' => '用户昵称']) - ->addColumn('headimg', 'string', ['limit' => 255, 'default' => '', 'comment' => '头像地址']) - ->addColumn('authorize', 'string', ['limit' => 255, 'default' => '', 'comment' => '权限授权']) - ->addColumn('contact_qq', 'string', ['limit' => 20, 'default' => '', 'comment' => '联系QQ']) - ->addColumn('contact_mail', 'string', ['limit' => 20, 'default' => '', 'comment' => '联系邮箱']) - ->addColumn('contact_phone', 'string', ['limit' => 20, 'default' => '', 'comment' => '联系手机']) - ->addColumn('login_ip', 'string', ['limit' => 255, 'default' => '', 'comment' => '登录地址']) - ->addColumn('login_at', 'string', ['limit' => 20, 'default' => '', 'comment' => '登录时间']) - ->addColumn('login_num', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '登录次数']) - ->addColumn('describe', 'string', ['limit' => 255, 'default' => '', 'comment' => '备注说明']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '状态(0禁用,1启用)']) - ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '排序权重']) - ->addColumn('is_deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除(1删除,0未删)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('usertype', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '用户类型']) + ->addColumn('username', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '用户账号']) + ->addColumn('password', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '用户密码']) + ->addColumn('nickname', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '用户昵称']) + ->addColumn('headimg', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '头像地址']) + ->addColumn('authorize', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '权限授权']) + ->addColumn('contact_qq', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '联系QQ']) + ->addColumn('contact_mail', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '联系邮箱']) + ->addColumn('contact_phone', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '联系手机']) + ->addColumn('login_ip', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '登录地址']) + ->addColumn('login_at', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '登录时间']) + ->addColumn('login_num', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '登录次数']) + ->addColumn('describe', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '备注说明']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '状态(0禁用,1启用)']) + ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) + ->addColumn('is_deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除(1删除,0未删)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('status', ['name' => 'idx_system_user_status']) ->addIndex('username', ['name' => 'idx_system_user_username']) ->addIndex('is_deleted', ['name' => 'idx_system_user_is_deleted']) diff --git a/app/data/database/20221013045838_install_user.php b/app/data/database/20221013045838_install_user.php index debf2f86c..6529d15f3 100644 --- a/app/data/database/20221013045838_install_user.php +++ b/app/data/database/20221013045838_install_user.php @@ -7,6 +7,9 @@ use think\migration\Migrator; */ class InstallUser extends Migrator { + /** + * 创建数据库 + */ public function change() { $this->_create_base_postage_company(); @@ -57,15 +60,15 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-快递-公司', ]) - ->addColumn('name', 'string', ['limit' => 50, 'default' => '', 'comment' => '快递公司名称']) - ->addColumn('code_1', 'string', ['limit' => 50, 'default' => '', 'comment' => '快递公司代码']) - ->addColumn('code_2', 'string', ['limit' => 50, 'default' => '', 'comment' => '百度快递100代码']) - ->addColumn('code_3', 'string', ['limit' => 50, 'default' => '', 'comment' => '官方快递100代码']) - ->addColumn('remark', 'string', ['limit' => 512, 'default' => '', 'comment' => '快递公司描述']) - ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '排序权重']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '状态(0.无效,1.有效)']) - ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态(1已删除,0未删除)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('name', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '快递公司名称']) + ->addColumn('code_1', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '快递公司代码']) + ->addColumn('code_2', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '百度快递100代码']) + ->addColumn('code_3', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '官方快递100代码']) + ->addColumn('remark', 'string', ['limit' => 512, 'default' => '', 'null' => true, 'comment' => '快递公司描述']) + ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '状态(0.无效,1.有效)']) + ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(1已删除,0未删除)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('code_1', ['name' => 'idx_base_postage_company_code_1']) ->addIndex('code_2', ['name' => 'idx_base_postage_company_code_2']) ->addIndex('code_3', ['name' => 'idx_base_postage_company_code_3']) @@ -96,16 +99,16 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-快递-区域', ]) - ->addColumn('pid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '上级PID']) - ->addColumn('first', 'string', ['limit' => 50, 'default' => '', 'comment' => '首字母']) - ->addColumn('short', 'string', ['limit' => 100, 'default' => '', 'comment' => '区域简称']) - ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'comment' => '区域名称']) - ->addColumn('level', 'integer', ['limit' => 4, 'default' => 0, 'comment' => '区域层级']) - ->addColumn('pinyin', 'string', ['limit' => 100, 'default' => '', 'comment' => '区域拼音']) - ->addColumn('code', 'string', ['limit' => 100, 'default' => '', 'comment' => '区域邮编']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '使用状态']) - ->addColumn('lng', 'string', ['limit' => 100, 'default' => '', 'comment' => '所在经度']) - ->addColumn('lat', 'string', ['limit' => 100, 'default' => '', 'comment' => '所在纬度']) + ->addColumn('pid', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '上级PID']) + ->addColumn('first', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '首字母']) + ->addColumn('short', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '区域简称']) + ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '区域名称']) + ->addColumn('level', 'integer', ['limit' => 4, 'default' => 0, 'null' => true, 'comment' => '区域层级']) + ->addColumn('pinyin', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '区域拼音']) + ->addColumn('code', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '区域邮编']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '使用状态']) + ->addColumn('lng', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '所在经度']) + ->addColumn('lat', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '所在纬度']) ->addIndex('pid', ['name' => 'idx_base_postage_region_pid']) ->addIndex('name', ['name' => 'idx_base_postage_region_name']) ->save(); @@ -133,14 +136,14 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-快递-模板', ]) - ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'comment' => '模板编号']) - ->addColumn('name', 'string', ['limit' => 200, 'default' => '', 'comment' => '模板名称']) - ->addColumn('normal', 'text', ['default' => null, 'comment' => '默认规则']) - ->addColumn('content', 'text', ['default' => null, 'comment' => '模板规则']) - ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '排序权重']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '模板状态']) - ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '模板编号']) + ->addColumn('name', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '模板名称']) + ->addColumn('normal', 'text', ['default' => null, 'null' => true, 'comment' => '默认规则']) + ->addColumn('content', 'text', ['default' => null, 'null' => true, 'comment' => '模板规则']) + ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '模板状态']) + ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('code', ['name' => 'idx_base_postage_template_code']) ->addIndex('status', ['name' => 'idx_base_postage_template_status']) ->addIndex('deleted', ['name' => 'idx_base_postage_template_deleted']) @@ -169,13 +172,13 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-基础-折扣', ]) - ->addColumn('name', 'string', ['limit' => 200, 'default' => '', 'comment' => '方案名称']) - ->addColumn('items', 'text', ['default' => null, 'comment' => '方案规则']) - ->addColumn('remark', 'string', ['limit' => 500, 'default' => '', 'comment' => '方案描述']) - ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '排序权重']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '方案状态(1使用,0禁用)']) - ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('name', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '方案名称']) + ->addColumn('items', 'text', ['default' => null, 'null' => true, 'comment' => '方案规则']) + ->addColumn('remark', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '方案描述']) + ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '方案状态(1使用,0禁用)']) + ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('status', ['name' => 'idx_base_user_discount_status']) ->addIndex('deleted', ['name' => 'idx_base_user_discount_deleted']) ->save(); @@ -203,14 +206,14 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-基础-通知', ]) - ->addColumn('type', 'string', ['limit' => 50, 'default' => '', 'comment' => '消息类型']) - ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'comment' => '消息名称']) - ->addColumn('content', 'text', ['default' => null, 'comment' => '消息内容']) - ->addColumn('num_read', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '阅读次数']) - ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '排序权重']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '消息状态(1使用,0禁用)']) - ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('type', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '消息类型']) + ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '消息名称']) + ->addColumn('content', 'text', ['default' => null, 'null' => true, 'comment' => '消息内容']) + ->addColumn('num_read', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '阅读次数']) + ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '消息状态(1使用,0禁用)']) + ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('type', ['name' => 'idx_base_user_message_type']) ->addIndex('status', ['name' => 'idx_base_user_message_status']) ->addIndex('deleted', ['name' => 'idx_base_user_message_deleted']) @@ -239,16 +242,16 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-基础-支付', ]) - ->addColumn('type', 'string', ['limit' => 50, 'default' => '', 'comment' => '支付类型']) - ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'comment' => '通道编号']) - ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'comment' => '支付名称']) - ->addColumn('cover', 'string', ['limit' => 500, 'default' => '', 'comment' => '支付图标']) - ->addColumn('content', 'text', ['default' => null, 'comment' => '支付参数']) - ->addColumn('remark', 'string', ['limit' => 500, 'default' => '', 'comment' => '支付说明']) - ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '排序权重']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '支付状态(1使用,0禁用)']) - ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('type', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '支付类型']) + ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '通道编号']) + ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '支付名称']) + ->addColumn('cover', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '支付图标']) + ->addColumn('content', 'text', ['default' => null, 'null' => true, 'comment' => '支付参数']) + ->addColumn('remark', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '支付说明']) + ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '支付状态(1使用,0禁用)']) + ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('type', ['name' => 'idx_base_user_payment_type']) ->addIndex('code', ['name' => 'idx_base_user_payment_code']) ->addIndex('status', ['name' => 'idx_base_user_payment_status']) @@ -278,24 +281,24 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-用户-等级', ]) - ->addColumn('name', 'string', ['limit' => 200, 'default' => '', 'comment' => '用户级别名称']) - ->addColumn('number', 'integer', ['limit' => 2, 'default' => 0, 'comment' => '用户级别序号']) - ->addColumn('rebate_rule', 'string', ['limit' => 255, 'default' => '', 'comment' => '用户奖利规则']) - ->addColumn('upgrade_type', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '会员升级规则(0单个,1同时)']) - ->addColumn('upgrade_team', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '团队人数统计(0不计,1累计)']) - ->addColumn('goods_vip_status', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '入会礼包状态']) - ->addColumn('order_amount_status', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '订单金额状态']) - ->addColumn('order_amount_number', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '订单金额累计']) - ->addColumn('teams_users_status', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '团队人数状态']) - ->addColumn('teams_users_number', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '团队人数累计']) - ->addColumn('teams_direct_status', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '直推人数状态']) - ->addColumn('teams_direct_number', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '直推人数累计']) - ->addColumn('teams_indirect_status', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '间推人数状态']) - ->addColumn('teams_indirect_number', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '间推人数累计']) - ->addColumn('remark', 'string', ['limit' => 500, 'default' => '', 'comment' => '用户级别描述']) - ->addColumn('utime', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '等级更新时间']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '用户等级状态(1使用,0禁用)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '等级创建时间']) + ->addColumn('name', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '用户级别名称']) + ->addColumn('number', 'integer', ['limit' => 2, 'default' => 0, 'null' => true, 'comment' => '用户级别序号']) + ->addColumn('rebate_rule', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '用户奖利规则']) + ->addColumn('upgrade_type', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '会员升级规则(0单个,1同时)']) + ->addColumn('upgrade_team', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '团队人数统计(0不计,1累计)']) + ->addColumn('goods_vip_status', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '入会礼包状态']) + ->addColumn('order_amount_status', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '订单金额状态']) + ->addColumn('order_amount_number', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '订单金额累计']) + ->addColumn('teams_users_status', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '团队人数状态']) + ->addColumn('teams_users_number', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '团队人数累计']) + ->addColumn('teams_direct_status', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '直推人数状态']) + ->addColumn('teams_direct_number', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '直推人数累计']) + ->addColumn('teams_indirect_status', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '间推人数状态']) + ->addColumn('teams_indirect_number', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '间推人数累计']) + ->addColumn('remark', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '用户级别描述']) + ->addColumn('utime', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '等级更新时间']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '用户等级状态(1使用,0禁用)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '等级创建时间']) ->addIndex('status', ['name' => 'idx_base_user_upgrade_status']) ->addIndex('number', ['name' => 'idx_base_user_upgrade_number']) ->save(); @@ -323,20 +326,20 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-文章-内容', ]) - ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'comment' => '文章编号']) - ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'comment' => '文章标题']) - ->addColumn('mark', 'string', ['limit' => 200, 'default' => '', 'comment' => '文章标签']) - ->addColumn('cover', 'string', ['limit' => 500, 'default' => '', 'comment' => '文章封面']) - ->addColumn('remark', 'string', ['limit' => 500, 'default' => '', 'comment' => '备注说明']) - ->addColumn('content', 'text', ['default' => null, 'comment' => '文章内容']) - ->addColumn('num_like', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '文章点赞数']) - ->addColumn('num_read', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '文章阅读数']) - ->addColumn('num_collect', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '文章收藏数']) - ->addColumn('num_comment', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '文章评论数']) - ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '排序权重']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '文章状态(1使用,0禁用)']) - ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态(0未删,1已删)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '文章编号']) + ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '文章标题']) + ->addColumn('mark', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '文章标签']) + ->addColumn('cover', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '文章封面']) + ->addColumn('remark', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '备注说明']) + ->addColumn('content', 'text', ['default' => null, 'null' => true, 'comment' => '文章内容']) + ->addColumn('num_like', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '文章点赞数']) + ->addColumn('num_read', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '文章阅读数']) + ->addColumn('num_collect', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '文章收藏数']) + ->addColumn('num_comment', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '文章评论数']) + ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '文章状态(1使用,0禁用)']) + ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('code', ['name' => 'idx_data_news_item_code']) ->addIndex('status', ['name' => 'idx_data_news_item_status']) ->addIndex('deleted', ['name' => 'idx_data_news_item_deleted']) @@ -365,12 +368,12 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-文章-标签', ]) - ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'comment' => '标签名称']) - ->addColumn('remark', 'string', ['limit' => 500, 'default' => '', 'comment' => '标签说明']) - ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '排序权重']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '标签状态(1使用,0禁用)']) - ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '标签名称']) + ->addColumn('remark', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '标签说明']) + ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '标签状态(1使用,0禁用)']) + ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('status', ['name' => 'idx_data_news_mark_status']) ->addIndex('deleted', ['name' => 'idx_data_news_mark_deleted']) ->save(); @@ -398,12 +401,12 @@ class InstallUser extends Migrator $this->table($table, [ '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评论)']) - ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'comment' => '文章编号']) - ->addColumn('reply', 'text', ['default' => null, 'comment' => '评论内容']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '记录状态(0无效,1待审核,2已审核)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户UID']) + ->addColumn('type', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录类型(1收藏,2点赞,3历史,4评论)']) + ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '文章编号']) + ->addColumn('reply', 'text', ['default' => null, 'null' => true, 'comment' => '评论内容']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录状态(0无效,1待审核,2已审核)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('type', ['name' => 'idx_data_news_x_collect_type']) ->addIndex('code', ['name' => 'idx_data_news_x_collect_code']) ->addIndex('status', ['name' => 'idx_data_news_x_collect_status']) @@ -433,50 +436,50 @@ class InstallUser extends Migrator $this->table($table, [ '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']) - ->addColumn('pid2', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '推荐人二级UID']) - ->addColumn('pids', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '推荐人绑定状态']) - ->addColumn('path', 'string', ['limit' => 999, 'default' => '-', 'comment' => '推荐关系路径']) - ->addColumn('layer', 'integer', ['limit' => 20, 'default' => 1, 'comment' => '推荐关系层级']) - ->addColumn('openid1', 'string', ['limit' => 50, 'default' => '', 'comment' => '小程序OPENID']) - ->addColumn('openid2', 'string', ['limit' => 50, 'default' => '', 'comment' => '服务号OPENID']) - ->addColumn('unionid', 'string', ['limit' => 50, 'default' => '', 'comment' => '公众号UnionID']) - ->addColumn('phone', 'string', ['limit' => 20, 'default' => '', 'comment' => '用户手机']) - ->addColumn('headimg', 'string', ['limit' => 500, 'default' => '', 'comment' => '用户头像']) - ->addColumn('username', 'string', ['limit' => 50, 'default' => '', 'comment' => '用户姓名']) - ->addColumn('nickname', 'string', ['limit' => 99, 'default' => '', 'comment' => '用户昵称']) - ->addColumn('password', 'string', ['limit' => 32, 'default' => '', 'comment' => '登录密码']) - ->addColumn('region_province', 'string', ['limit' => 30, 'default' => '', 'comment' => '所在省份']) - ->addColumn('region_city', 'string', ['limit' => 30, 'default' => '', 'comment' => '所在城市']) - ->addColumn('region_area', 'string', ['limit' => 30, 'default' => '', 'comment' => '所在区域']) - ->addColumn('base_age', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '用户年龄']) - ->addColumn('base_sex', 'string', ['limit' => 10, 'default' => '', 'comment' => '用户性别']) - ->addColumn('base_height', 'string', ['limit' => 10, 'default' => '', 'comment' => '用户身高']) - ->addColumn('base_weight', 'string', ['limit' => 10, 'default' => '', 'comment' => '用户体重']) - ->addColumn('base_birthday', 'string', ['limit' => 20, 'default' => '', 'comment' => '用户生日']) - ->addColumn('vip_code', 'integer', ['limit' => 20, 'default' => 0, 'comment' => 'VIP等级编号']) - ->addColumn('vip_name', 'string', ['limit' => 30, 'default' => '普通用户', 'comment' => 'VIP等级名称']) - ->addColumn('vip_order', 'string', ['limit' => 20, 'default' => '', 'comment' => 'VIP升级订单']) - ->addColumn('vip_datetime', 'string', ['limit' => 20, 'default' => '', 'comment' => 'VIP等级时间']) - ->addColumn('buy_vip_entry', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '是否入会礼包']) - ->addColumn('buy_last_date', 'string', ['limit' => 20, 'default' => '', 'comment' => '最后支付时间']) - ->addColumn('rebate_total', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '返利金额统计']) - ->addColumn('rebate_used', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '返利提现统计']) - ->addColumn('rebate_lock', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '返利锁定统计']) - ->addColumn('balance_total', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '累计充值统计']) - ->addColumn('balance_used', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '已经使用统计']) - ->addColumn('teams_users_total', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '团队人数统计']) - ->addColumn('teams_users_direct', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '直属人数团队']) - ->addColumn('teams_users_indirect', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '间接人数团队']) - ->addColumn('order_amount_total', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '订单交易统计']) - ->addColumn('teams_amount_total', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '二级团队业绩']) - ->addColumn('teams_amount_direct', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '直属团队业绩']) - ->addColumn('teams_amount_indirect', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '间接团队业绩']) - ->addColumn('remark', 'string', ['limit' => 500, 'default' => '', 'comment' => '用户备注描述']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '用户状态(1正常,0已黑)']) - ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态(0未删,1已删)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '注册时间']) + ->addColumn('pid0', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '临时推荐人UID']) + ->addColumn('pid1', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '推荐人一级UID']) + ->addColumn('pid2', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '推荐人二级UID']) + ->addColumn('pids', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '推荐人绑定状态']) + ->addColumn('path', 'string', ['limit' => 999, 'default' => '-', 'null' => true, 'comment' => '推荐关系路径']) + ->addColumn('layer', 'integer', ['limit' => 20, 'default' => 1, 'null' => true, 'comment' => '推荐关系层级']) + ->addColumn('openid1', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '小程序OPENID']) + ->addColumn('openid2', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '服务号OPENID']) + ->addColumn('unionid', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '公众号UnionID']) + ->addColumn('phone', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '用户手机']) + ->addColumn('headimg', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '用户头像']) + ->addColumn('username', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '用户姓名']) + ->addColumn('nickname', 'string', ['limit' => 99, 'default' => '', 'null' => true, 'comment' => '用户昵称']) + ->addColumn('password', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '登录密码']) + ->addColumn('region_province', 'string', ['limit' => 30, 'default' => '', 'null' => true, 'comment' => '所在省份']) + ->addColumn('region_city', 'string', ['limit' => 30, 'default' => '', 'null' => true, 'comment' => '所在城市']) + ->addColumn('region_area', 'string', ['limit' => 30, 'default' => '', 'null' => true, 'comment' => '所在区域']) + ->addColumn('base_age', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户年龄']) + ->addColumn('base_sex', 'string', ['limit' => 10, 'default' => '', 'null' => true, 'comment' => '用户性别']) + ->addColumn('base_height', 'string', ['limit' => 10, 'default' => '', 'null' => true, 'comment' => '用户身高']) + ->addColumn('base_weight', 'string', ['limit' => 10, 'default' => '', 'null' => true, 'comment' => '用户体重']) + ->addColumn('base_birthday', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '用户生日']) + ->addColumn('vip_code', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => 'VIP等级编号']) + ->addColumn('vip_name', 'string', ['limit' => 30, 'default' => '普通用户', 'null' => true, 'comment' => 'VIP等级名称']) + ->addColumn('vip_order', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => 'VIP升级订单']) + ->addColumn('vip_datetime', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => 'VIP等级时间']) + ->addColumn('buy_vip_entry', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '是否入会礼包']) + ->addColumn('buy_last_date', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '最后支付时间']) + ->addColumn('rebate_total', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '返利金额统计']) + ->addColumn('rebate_used', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '返利提现统计']) + ->addColumn('rebate_lock', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '返利锁定统计']) + ->addColumn('balance_total', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '累计充值统计']) + ->addColumn('balance_used', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '已经使用统计']) + ->addColumn('teams_users_total', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '团队人数统计']) + ->addColumn('teams_users_direct', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '直属人数团队']) + ->addColumn('teams_users_indirect', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '间接人数团队']) + ->addColumn('order_amount_total', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '订单交易统计']) + ->addColumn('teams_amount_total', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '二级团队业绩']) + ->addColumn('teams_amount_direct', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '直属团队业绩']) + ->addColumn('teams_amount_indirect', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '间接团队业绩']) + ->addColumn('remark', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '用户备注描述']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '用户状态(1正常,0已黑)']) + ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '注册时间']) ->addIndex('status', ['name' => 'idx_data_user_status']) ->addIndex('deleted', ['name' => 'idx_data_user_deleted']) ->addIndex('openid1', ['name' => 'idx_data_user_openid1']) @@ -511,20 +514,20 @@ class InstallUser extends Migrator $this->table($table, [ '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默认)']) - ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'comment' => '地址编号']) - ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'comment' => '收货姓名']) - ->addColumn('phone', 'string', ['limit' => 20, 'default' => '', 'comment' => '收货手机']) - ->addColumn('idcode', 'string', ['limit' => 255, 'default' => '', 'comment' => '身体证号']) - ->addColumn('idimg1', 'string', ['limit' => 500, 'default' => '', 'comment' => '身份证正面']) - ->addColumn('idimg2', 'string', ['limit' => 500, 'default' => '', 'comment' => '身份证反面']) - ->addColumn('province', 'string', ['limit' => 100, 'default' => '', 'comment' => '地址-省份']) - ->addColumn('city', 'string', ['limit' => 100, 'default' => '', 'comment' => '地址-城市']) - ->addColumn('area', 'string', ['limit' => 100, 'default' => '', 'comment' => '地址-区域']) - ->addColumn('address', 'string', ['limit' => 255, 'default' => '', 'comment' => '地址-详情']) - ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户UID']) + ->addColumn('type', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '地址类型(0普通,1默认)']) + ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '地址编号']) + ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '收货姓名']) + ->addColumn('phone', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '收货手机']) + ->addColumn('idcode', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '身体证号']) + ->addColumn('idimg1', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '身份证正面']) + ->addColumn('idimg2', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '身份证反面']) + ->addColumn('province', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '地址-省份']) + ->addColumn('city', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '地址-城市']) + ->addColumn('area', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '地址-区域']) + ->addColumn('address', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '地址-详情']) + ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('type', ['name' => 'idx_data_user_address_type']) ->addIndex('code', ['name' => 'idx_data_user_address_code']) ->addIndex('deleted', ['name' => 'idx_data_user_address_deleted']) @@ -554,15 +557,15 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-用户-余额', ]) - ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '用户UID']) - ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'comment' => '充值编号']) - ->addColumn('name', 'string', ['limit' => 200, 'default' => '', 'comment' => '充值名称']) - ->addColumn('remark', 'string', ['limit' => 999, 'default' => '', 'comment' => '充值备注']) - ->addColumn('amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '充值金额']) - ->addColumn('upgrade', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '强制升级']) - ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态']) - ->addColumn('create_by', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '系统用户']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户UID']) + ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '充值编号']) + ->addColumn('name', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '充值名称']) + ->addColumn('remark', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '充值备注']) + ->addColumn('amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '充值金额']) + ->addColumn('upgrade', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '强制升级']) + ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态']) + ->addColumn('create_by', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '系统用户']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('code', ['name' => 'idx_data_user_balance_code']) ->addIndex('deleted', ['name' => 'idx_data_user_balance_deleted']) ->addIndex('uuid', ['name' => 'idx_data_user_balance_uuid']) @@ -591,13 +594,13 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-用户-会员', ]) - ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '登录用户']) - ->addColumn('phone', 'string', ['limit' => 20, 'default' => '', 'comment' => '用户手机']) - ->addColumn('regon_ip', 'string', ['limit' => 50, 'default' => '', 'comment' => '登录地址']) - ->addColumn('region_prov', 'string', ['limit' => 50, 'default' => '', 'comment' => '所有省份']) - ->addColumn('region_city', 'string', ['limit' => 50, 'default' => '', 'comment' => '所在城市']) - ->addColumn('region_area', 'string', ['limit' => 50, 'default' => '', 'comment' => '所在区间']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '注册时间']) + ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '登录用户']) + ->addColumn('phone', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '用户手机']) + ->addColumn('regon_ip', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '登录地址']) + ->addColumn('region_prov', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '所有省份']) + ->addColumn('region_city', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '所在城市']) + ->addColumn('region_area', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '所在区间']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '注册时间']) ->addIndex('uuid', ['name' => 'idx_data_user_logger_uuid']) ->save(); @@ -624,14 +627,14 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-用户-短信', ]) - ->addColumn('type', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '短信类型']) - ->addColumn('msgid', 'string', ['limit' => 50, 'default' => '', 'comment' => '消息编号']) - ->addColumn('phone', 'string', ['limit' => 100, 'default' => '', 'comment' => '目标手机']) - ->addColumn('region', 'string', ['limit' => 100, 'default' => '', 'comment' => '国家编号']) - ->addColumn('result', 'string', ['limit' => 100, 'default' => '', 'comment' => '返回结果']) - ->addColumn('content', 'string', ['limit' => 512, 'default' => '', 'comment' => '短信内容']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '短信状态(0失败,1成功)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('type', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '短信类型']) + ->addColumn('msgid', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '消息编号']) + ->addColumn('phone', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '目标手机']) + ->addColumn('region', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '国家编号']) + ->addColumn('result', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '返回结果']) + ->addColumn('content', 'string', ['limit' => 512, 'default' => '', 'null' => true, 'comment' => '短信内容']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '短信状态(0失败,1成功)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('type', ['name' => 'idx_data_user_message_type']) ->addIndex('status', ['name' => 'idx_data_user_message_status']) ->addIndex('phone', ['name' => 'idx_data_user_message_phone']) @@ -661,16 +664,16 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-用户-支付', ]) - ->addColumn('order_no', 'string', ['limit' => 20, 'default' => '', 'comment' => '订单单号']) - ->addColumn('order_name', 'string', ['limit' => 255, 'default' => '', 'comment' => '订单描述']) - ->addColumn('order_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '订单金额']) - ->addColumn('payment_code', 'string', ['limit' => 20, 'default' => '', 'comment' => '支付编号']) - ->addColumn('payment_type', 'string', ['limit' => 50, 'default' => '', 'comment' => '支付通道']) - ->addColumn('payment_trade', 'string', ['limit' => 100, 'default' => '', 'comment' => '支付单号']) - ->addColumn('payment_status', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '支付状态']) - ->addColumn('payment_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '支付金额']) - ->addColumn('payment_datetime', 'string', ['limit' => 20, 'default' => '', 'comment' => '支付时间']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('order_no', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '订单单号']) + ->addColumn('order_name', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '订单描述']) + ->addColumn('order_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '订单金额']) + ->addColumn('payment_code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '支付编号']) + ->addColumn('payment_type', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '支付通道']) + ->addColumn('payment_trade', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '支付单号']) + ->addColumn('payment_status', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '支付状态']) + ->addColumn('payment_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '支付金额']) + ->addColumn('payment_datetime', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '支付时间']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('order_no', ['name' => 'idx_data_user_payment_order_no']) ->addIndex('payment_code', ['name' => 'idx_data_user_payment_payment_code']) ->addIndex('payment_type', ['name' => 'idx_data_user_payment_payment_type']) @@ -701,18 +704,18 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-用户-返利', ]) - ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '用户UID']) - ->addColumn('date', 'string', ['limit' => 20, 'default' => '', 'comment' => '奖励日期']) - ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'comment' => '奖励编号']) - ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'comment' => '奖励类型']) - ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'comment' => '奖励名称']) - ->addColumn('amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '奖励数量']) - ->addColumn('order_no', 'string', ['limit' => 20, 'default' => '', 'comment' => '订单单号']) - ->addColumn('order_uuid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '订单用户']) - ->addColumn('order_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '订单金额']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '生效状态(0未生效,1已生效)']) - ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态(0未删除,1已删除)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户UID']) + ->addColumn('date', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '奖励日期']) + ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '奖励编号']) + ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '奖励类型']) + ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '奖励名称']) + ->addColumn('amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '奖励数量']) + ->addColumn('order_no', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '订单单号']) + ->addColumn('order_uuid', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '订单用户']) + ->addColumn('order_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '订单金额']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '生效状态(0未生效,1已生效)']) + ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删除,1已删除)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('type', ['name' => 'idx_data_user_rebate_type']) ->addIndex('date', ['name' => 'idx_data_user_rebate_date']) ->addIndex('code', ['name' => 'idx_data_user_rebate_code']) @@ -744,12 +747,12 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-用户-认证', ]) - ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '用户UID']) - ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'comment' => '授权类型']) - ->addColumn('time', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '有效时间']) - ->addColumn('token', 'string', ['limit' => 32, 'default' => '', 'comment' => '授权令牌']) - ->addColumn('tokenv', 'string', ['limit' => 32, 'default' => '', 'comment' => '授权验证']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户UID']) + ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '授权类型']) + ->addColumn('time', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '有效时间']) + ->addColumn('token', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '授权令牌']) + ->addColumn('tokenv', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '授权验证']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('uuid', ['name' => 'idx_data_user_token_uuid']) ->addIndex('type', ['name' => 'idx_data_user_token_type']) ->addIndex('time', ['name' => 'idx_data_user_token_time']) @@ -779,33 +782,33 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-用户-提现', ]) - ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '用户UID']) - ->addColumn('type', 'string', ['limit' => 30, 'default' => '', 'comment' => '提现方式']) - ->addColumn('date', 'string', ['limit' => 20, 'default' => '', 'comment' => '提现日期']) - ->addColumn('code', 'string', ['limit' => 100, 'default' => '', 'comment' => '提现单号']) - ->addColumn('appid', 'string', ['limit' => 100, 'default' => '', 'comment' => '公众号APPID']) - ->addColumn('openid', 'string', ['limit' => 100, 'default' => '', 'comment' => '公众号OPENID']) - ->addColumn('charge_rate', 'decimal', ['precision' => 20, 'scale' => 4, 'default' => '0.0000', 'comment' => '提现手续费比例']) - ->addColumn('charge_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '提现手续费金额']) - ->addColumn('amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '提现转账金额']) - ->addColumn('qrcode', 'string', ['limit' => 999, 'default' => '', 'comment' => '收款码图片地址']) - ->addColumn('bank_wseq', 'string', ['limit' => 20, 'default' => '', 'comment' => '微信银行编号']) - ->addColumn('bank_name', 'string', ['limit' => 100, 'default' => '', 'comment' => '开户银行名称']) - ->addColumn('bank_bran', 'string', ['limit' => 100, 'default' => '', 'comment' => '开户分行名称']) - ->addColumn('bank_user', 'string', ['limit' => 100, 'default' => '', 'comment' => '开户账号姓名']) - ->addColumn('bank_code', 'string', ['limit' => 100, 'default' => '', 'comment' => '开户银行卡号']) - ->addColumn('alipay_user', 'string', ['limit' => 100, 'default' => '', 'comment' => '支付宝姓名']) - ->addColumn('alipay_code', 'string', ['limit' => 100, 'default' => '', 'comment' => '支付宝账号']) - ->addColumn('remark', 'string', ['limit' => 200, 'default' => '', 'comment' => '提现描述']) - ->addColumn('trade_no', 'string', ['limit' => 100, 'default' => '', 'comment' => '交易单号']) - ->addColumn('trade_time', 'string', ['limit' => 20, 'default' => '', 'comment' => '打款时间']) - ->addColumn('change_time', 'string', ['limit' => 20, 'default' => '', 'comment' => '处理时间']) - ->addColumn('change_desc', 'string', ['limit' => 500, 'default' => '', 'comment' => '处理描述']) - ->addColumn('audit_status', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '审核状态']) - ->addColumn('audit_remark', 'string', ['limit' => 500, 'default' => '', 'comment' => '审核描述']) - ->addColumn('audit_datetime', 'string', ['limit' => 20, 'default' => '', 'comment' => '审核时间']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '提现状态(0失败,1待审核,2已审核,3打款中,4已打款,5已收款)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户UID']) + ->addColumn('type', 'string', ['limit' => 30, 'default' => '', 'null' => true, 'comment' => '提现方式']) + ->addColumn('date', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '提现日期']) + ->addColumn('code', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '提现单号']) + ->addColumn('appid', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '公众号APPID']) + ->addColumn('openid', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '公众号OPENID']) + ->addColumn('charge_rate', 'decimal', ['precision' => 20, 'scale' => 4, 'default' => '0.0000', 'null' => true, 'comment' => '提现手续费比例']) + ->addColumn('charge_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '提现手续费金额']) + ->addColumn('amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '提现转账金额']) + ->addColumn('qrcode', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '收款码图片地址']) + ->addColumn('bank_wseq', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '微信银行编号']) + ->addColumn('bank_name', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '开户银行名称']) + ->addColumn('bank_bran', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '开户分行名称']) + ->addColumn('bank_user', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '开户账号姓名']) + ->addColumn('bank_code', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '开户银行卡号']) + ->addColumn('alipay_user', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '支付宝姓名']) + ->addColumn('alipay_code', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '支付宝账号']) + ->addColumn('remark', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '提现描述']) + ->addColumn('trade_no', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '交易单号']) + ->addColumn('trade_time', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '打款时间']) + ->addColumn('change_time', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '处理时间']) + ->addColumn('change_desc', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '处理描述']) + ->addColumn('audit_status', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '审核状态']) + ->addColumn('audit_remark', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '审核描述']) + ->addColumn('audit_datetime', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '审核时间']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '提现状态(0失败,1待审核,2已审核,3打款中,4已打款,5已收款)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('code', ['name' => 'idx_data_user_transfer_code']) ->addIndex('status', ['name' => 'idx_data_user_transfer_status']) ->addIndex('date', ['name' => 'idx_data_user_transfer_date']) @@ -839,37 +842,37 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-商品-内容', ]) - ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'comment' => '商品编号']) - ->addColumn('name', 'string', ['limit' => 500, 'default' => '', 'comment' => '商品名称']) - ->addColumn('marks', 'string', ['limit' => 999, 'default' => '', 'comment' => '商品标签']) - ->addColumn('cateids', 'string', ['limit' => 999, 'default' => '', 'comment' => '分类编号']) - ->addColumn('cover', 'string', ['limit' => 999, 'default' => '', 'comment' => '商品封面']) - ->addColumn('slider', 'text', ['default' => null, 'comment' => '轮播图片']) - ->addColumn('remark', 'string', ['limit' => 999, 'default' => '', 'comment' => '商品描述']) - ->addColumn('content', 'text', ['default' => null, 'comment' => '商品详情']) - ->addColumn('payment', 'string', ['limit' => 999, 'default' => '', 'comment' => '支付方式']) - ->addColumn('data_specs', 'text', ['default' => null, 'comment' => '商品规格(JSON)']) - ->addColumn('data_items', 'text', ['default' => null, 'comment' => '商品规格(JSON)']) - ->addColumn('stock_total', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '商品库存统计']) - ->addColumn('stock_sales', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '商品销售统计']) - ->addColumn('stock_virtual', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '商品虚拟销量']) - ->addColumn('price_selling', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '最低销售价格']) - ->addColumn('price_market', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '最低市场价格']) - ->addColumn('discount_id', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '折扣方案编号']) - ->addColumn('truck_code', 'string', ['limit' => 20, 'default' => '', 'comment' => '物流运费模板']) - ->addColumn('truck_type', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '物流配送(0无需配送,1需要配送)']) - ->addColumn('rebate_type', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '参与返利(0无需返利,1需要返利)']) - ->addColumn('vip_entry', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '入会礼包(0非入会礼包,1是入会礼包)']) - ->addColumn('vip_upgrade', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '购买升级等级(0不升级,其他升级)']) - ->addColumn('limit_low_vip', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '限制最低等级(0不限制,其他限制)']) - ->addColumn('limit_max_num', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '最大购买数量(0不限制,其他限制)']) - ->addColumn('num_read', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '访问阅读统计']) - ->addColumn('state_hot', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '设置热度标签']) - ->addColumn('state_home', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '设置首页推荐']) - ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '列表排序权重']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '商品状态(1使用,0禁用)']) - ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态(0未删,1已删)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商品编号']) + ->addColumn('name', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '商品名称']) + ->addColumn('marks', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '商品标签']) + ->addColumn('cateids', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '分类编号']) + ->addColumn('cover', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '商品封面']) + ->addColumn('slider', 'text', ['default' => null, 'null' => true, 'comment' => '轮播图片']) + ->addColumn('remark', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '商品描述']) + ->addColumn('content', 'text', ['default' => null, 'null' => true, 'comment' => '商品详情']) + ->addColumn('payment', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '支付方式']) + ->addColumn('data_specs', 'text', ['default' => null, 'null' => true, 'comment' => '商品规格(JSON)']) + ->addColumn('data_items', 'text', ['default' => null, 'null' => true, 'comment' => '商品规格(JSON)']) + ->addColumn('stock_total', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '商品库存统计']) + ->addColumn('stock_sales', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '商品销售统计']) + ->addColumn('stock_virtual', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '商品虚拟销量']) + ->addColumn('price_selling', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '最低销售价格']) + ->addColumn('price_market', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '最低市场价格']) + ->addColumn('discount_id', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '折扣方案编号']) + ->addColumn('truck_code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '物流运费模板']) + ->addColumn('truck_type', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '物流配送(0无需配送,1需要配送)']) + ->addColumn('rebate_type', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '参与返利(0无需返利,1需要返利)']) + ->addColumn('vip_entry', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '入会礼包(0非入会礼包,1是入会礼包)']) + ->addColumn('vip_upgrade', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '购买升级等级(0不升级,其他升级)']) + ->addColumn('limit_low_vip', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '限制最低等级(0不限制,其他限制)']) + ->addColumn('limit_max_num', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '最大购买数量(0不限制,其他限制)']) + ->addColumn('num_read', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '访问阅读统计']) + ->addColumn('state_hot', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '设置热度标签']) + ->addColumn('state_home', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '设置首页推荐']) + ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '列表排序权重']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '商品状态(1使用,0禁用)']) + ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('code', ['name' => 'idx_shop_goods_code']) ->addIndex('status', ['name' => 'idx_shop_goods_status']) ->addIndex('deleted', ['name' => 'idx_shop_goods_deleted']) @@ -898,14 +901,14 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-商品-分类', ]) - ->addColumn('pid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '上级分类']) - ->addColumn('name', 'string', ['limit' => 255, 'default' => '', 'comment' => '分类名称']) - ->addColumn('cover', 'string', ['limit' => 500, 'default' => '', 'comment' => '分类图标']) - ->addColumn('remark', 'string', ['limit' => 999, 'default' => '', 'comment' => '分类描述']) - ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '排序权重']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '使用状态']) - ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('pid', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '上级分类']) + ->addColumn('name', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '分类名称']) + ->addColumn('cover', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '分类图标']) + ->addColumn('remark', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '分类描述']) + ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '使用状态']) + ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('sort', ['name' => 'idx_shop_goods_cate_sort']) ->addIndex('status', ['name' => 'idx_shop_goods_cate_status']) ->addIndex('deleted', ['name' => 'idx_shop_goods_cate_deleted']) @@ -934,19 +937,19 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-商品-规格', ]) - ->addColumn('goods_sku', 'string', ['limit' => 20, 'default' => '', 'comment' => '商品SKU']) - ->addColumn('goods_code', 'string', ['limit' => 20, 'default' => '', 'comment' => '商品编号']) - ->addColumn('goods_spec', 'string', ['limit' => 100, 'default' => '', 'comment' => '商品规格']) - ->addColumn('stock_sales', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '销售数量']) - ->addColumn('stock_total', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '商品库存']) - ->addColumn('price_selling', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '销售价格']) - ->addColumn('price_market', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '市场价格']) - ->addColumn('number_virtual', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '虚拟销量']) - ->addColumn('number_express', 'integer', ['limit' => 20, 'default' => 1, 'comment' => '配送计件']) - ->addColumn('reward_balance', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '奖励余额']) - ->addColumn('reward_integral', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '奖励积分']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '商品状态']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('goods_sku', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商品SKU']) + ->addColumn('goods_code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商品编号']) + ->addColumn('goods_spec', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '商品规格']) + ->addColumn('stock_sales', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '销售数量']) + ->addColumn('stock_total', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '商品库存']) + ->addColumn('price_selling', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '销售价格']) + ->addColumn('price_market', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '市场价格']) + ->addColumn('number_virtual', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '虚拟销量']) + ->addColumn('number_express', 'integer', ['limit' => 20, 'default' => 1, 'null' => true, 'comment' => '配送计件']) + ->addColumn('reward_balance', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '奖励余额']) + ->addColumn('reward_integral', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '奖励积分']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '商品状态']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('goods_code', ['name' => 'idx_shop_goods_item_goods_code']) ->addIndex('goods_spec', ['name' => 'idx_shop_goods_item_goods_spec']) ->addIndex('status', ['name' => 'idx_shop_goods_item_status']) @@ -975,11 +978,11 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-商品-标签', ]) - ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'comment' => '标签名称']) - ->addColumn('remark', 'string', ['limit' => 200, 'default' => '', 'comment' => '标签描述']) - ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '排序权重']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '标签状态(1使用,0禁用)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '标签名称']) + ->addColumn('remark', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '标签描述']) + ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '标签状态(1使用,0禁用)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('sort', ['name' => 'idx_shop_goods_mark_sort']) ->addIndex('status', ['name' => 'idx_shop_goods_mark_status']) ->save(); @@ -1007,13 +1010,13 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-商品-库存', ]) - ->addColumn('batch_no', 'string', ['limit' => 20, 'default' => '', 'comment' => '操作批量']) - ->addColumn('goods_code', 'string', ['limit' => 20, 'default' => '', 'comment' => '商品编号']) - ->addColumn('goods_spec', 'string', ['limit' => 100, 'default' => '', 'comment' => '商品规格']) - ->addColumn('goods_stock', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '入库数量']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '数据状态(1使用,0禁用)']) - ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态(0未删,1已删)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('batch_no', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '操作批量']) + ->addColumn('goods_code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商品编号']) + ->addColumn('goods_spec', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '商品规格']) + ->addColumn('goods_stock', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '入库数量']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '数据状态(1使用,0禁用)']) + ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('status', ['name' => 'idx_shop_goods_stock_status']) ->addIndex('deleted', ['name' => 'idx_shop_goods_stock_deleted']) ->save(); @@ -1041,40 +1044,40 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-订单-内容', ]) - ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '下单用户编号']) - ->addColumn('puid1', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '推荐一层用户']) - ->addColumn('puid2', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '推荐二层用户']) - ->addColumn('order_no', 'string', ['limit' => 20, 'default' => '', 'comment' => '商品订单单号']) - ->addColumn('amount_real', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '订单实际金额']) - ->addColumn('amount_total', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '订单统计金额']) - ->addColumn('amount_goods', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '商品统计金额']) - ->addColumn('amount_reduct', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '随机减免金额']) - ->addColumn('amount_express', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '快递费用金额']) - ->addColumn('amount_discount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '折扣后的金额']) - ->addColumn('payment_type', 'string', ['limit' => 20, 'default' => '', 'comment' => '实际支付平台']) - ->addColumn('payment_code', 'string', ['limit' => 20, 'default' => '', 'comment' => '实际通道编号']) - ->addColumn('payment_allow', 'string', ['limit' => 999, 'default' => '', 'comment' => '允许支付通道']) - ->addColumn('payment_trade', 'string', ['limit' => 80, 'default' => '', 'comment' => '实际支付单号']) - ->addColumn('payment_status', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '实际支付状态']) - ->addColumn('payment_image', 'string', ['limit' => 999, 'default' => '', 'comment' => '支付凭证图片']) - ->addColumn('payment_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '实际支付金额']) - ->addColumn('payment_balance', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '余额抵扣金额']) - ->addColumn('payment_remark', 'string', ['limit' => 500, 'default' => '', 'comment' => '支付结果描述']) - ->addColumn('payment_datetime', 'string', ['limit' => 20, 'default' => '', 'comment' => '支付到账时间']) - ->addColumn('number_goods', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '订单商品数量']) - ->addColumn('number_express', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '订单快递计数']) - ->addColumn('truck_type', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '物流配送类型(0无需配送,1需要配送)']) - ->addColumn('rebate_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '参与返利金额']) - ->addColumn('reward_balance', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '奖励账户余额']) - ->addColumn('order_remark', 'string', ['limit' => 999, 'default' => '', 'comment' => '订单用户备注']) - ->addColumn('cancel_status', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '订单取消状态']) - ->addColumn('cancel_remark', 'string', ['limit' => 200, 'default' => '', 'comment' => '订单取消描述']) - ->addColumn('cancel_datetime', 'string', ['limit' => 20, 'default' => '', 'comment' => '订单取消时间']) - ->addColumn('deleted_status', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '订单删除状态(0未删,1已删)']) - ->addColumn('deleted_remark', 'string', ['limit' => 255, 'default' => '', 'comment' => '订单删除描述']) - ->addColumn('deleted_datetime', 'string', ['limit' => 20, 'default' => '', 'comment' => '订单删除时间']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '订单流程状态(0已取消,1预订单,2待支付,3支付中,4已支付,5已发货,6已完成)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '订单创建时间']) + ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '下单用户编号']) + ->addColumn('puid1', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '推荐一层用户']) + ->addColumn('puid2', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '推荐二层用户']) + ->addColumn('order_no', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商品订单单号']) + ->addColumn('amount_real', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '订单实际金额']) + ->addColumn('amount_total', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '订单统计金额']) + ->addColumn('amount_goods', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品统计金额']) + ->addColumn('amount_reduct', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '随机减免金额']) + ->addColumn('amount_express', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '快递费用金额']) + ->addColumn('amount_discount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '折扣后的金额']) + ->addColumn('payment_type', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '实际支付平台']) + ->addColumn('payment_code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '实际通道编号']) + ->addColumn('payment_allow', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '允许支付通道']) + ->addColumn('payment_trade', 'string', ['limit' => 80, 'default' => '', 'null' => true, 'comment' => '实际支付单号']) + ->addColumn('payment_status', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '实际支付状态']) + ->addColumn('payment_image', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '支付凭证图片']) + ->addColumn('payment_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '实际支付金额']) + ->addColumn('payment_balance', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '余额抵扣金额']) + ->addColumn('payment_remark', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '支付结果描述']) + ->addColumn('payment_datetime', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '支付到账时间']) + ->addColumn('number_goods', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '订单商品数量']) + ->addColumn('number_express', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '订单快递计数']) + ->addColumn('truck_type', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '物流配送类型(0无需配送,1需要配送)']) + ->addColumn('rebate_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '参与返利金额']) + ->addColumn('reward_balance', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '奖励账户余额']) + ->addColumn('order_remark', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '订单用户备注']) + ->addColumn('cancel_status', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '订单取消状态']) + ->addColumn('cancel_remark', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '订单取消描述']) + ->addColumn('cancel_datetime', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '订单取消时间']) + ->addColumn('deleted_status', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '订单删除状态(0未删,1已删)']) + ->addColumn('deleted_remark', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '订单删除描述']) + ->addColumn('deleted_datetime', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '订单删除时间']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '订单流程状态(0已取消,1预订单,2待支付,3支付中,4已支付,5已发货,6已完成)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '订单创建时间']) ->addIndex('status', ['name' => 'idx_shop_order_status']) ->addIndex('order_no', ['name' => 'idx_shop_order_order_no']) ->addIndex('cancel_status', ['name' => 'idx_shop_order_cancel_status']) @@ -1107,36 +1110,36 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-订单-商品', ]) - ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '商城用户编号']) - ->addColumn('order_no', 'string', ['limit' => 20, 'default' => '', 'comment' => '商城订单单号']) - ->addColumn('goods_sku', 'string', ['limit' => 20, 'default' => '', 'comment' => '商城商品SKU']) - ->addColumn('goods_code', 'string', ['limit' => 20, 'default' => '', 'comment' => '商城商品编号']) - ->addColumn('goods_spec', 'string', ['limit' => 100, 'default' => '', 'comment' => '商城商品规格']) - ->addColumn('goods_name', 'string', ['limit' => 250, 'default' => '', 'comment' => '商城商品名称']) - ->addColumn('goods_cover', 'string', ['limit' => 500, 'default' => '', 'comment' => '商品封面图片']) - ->addColumn('goods_payment', 'string', ['limit' => 999, 'default' => '', 'comment' => '指定支付通道']) - ->addColumn('price_market', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '商品市场单价']) - ->addColumn('price_selling', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '商品销售单价']) - ->addColumn('total_market', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '商品市场总价']) - ->addColumn('total_selling', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '商品销售总价']) - ->addColumn('reward_balance', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '商品奖励余额']) - ->addColumn('reward_integral', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '商品奖励积分']) - ->addColumn('stock_sales', 'integer', ['limit' => 20, 'default' => 1, 'comment' => '包含商品数量']) - ->addColumn('vip_name', 'string', ['limit' => 30, 'default' => '', 'comment' => '用户等级名称']) - ->addColumn('vip_code', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '用户等级序号']) - ->addColumn('vip_entry', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '是否入会礼包(0非礼包,1是礼包)']) - ->addColumn('vip_upgrade', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '升级用户等级']) - ->addColumn('truck_type', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '物流配送类型(0虚物,1实物)']) - ->addColumn('truck_code', 'string', ['limit' => 20, 'default' => '', 'comment' => '快递邮费模板']) - ->addColumn('truck_number', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '快递计费基数']) - ->addColumn('rebate_type', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '参与返利状态(0不返,1返利)']) - ->addColumn('rebate_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '参与返利金额']) - ->addColumn('discount_id', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '优惠方案编号']) - ->addColumn('discount_rate', 'decimal', ['precision' => 20, 'scale' => 6, 'default' => '100.000000', 'comment' => '销售价格折扣']) - ->addColumn('discount_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '商品优惠金额']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '商品状态(1使用,0禁用)']) - ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态(0未删,1已删)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '订单创建时间']) + ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '商城用户编号']) + ->addColumn('order_no', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商城订单单号']) + ->addColumn('goods_sku', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商城商品SKU']) + ->addColumn('goods_code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商城商品编号']) + ->addColumn('goods_spec', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '商城商品规格']) + ->addColumn('goods_name', 'string', ['limit' => 250, 'default' => '', 'null' => true, 'comment' => '商城商品名称']) + ->addColumn('goods_cover', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '商品封面图片']) + ->addColumn('goods_payment', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '指定支付通道']) + ->addColumn('price_market', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品市场单价']) + ->addColumn('price_selling', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品销售单价']) + ->addColumn('total_market', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品市场总价']) + ->addColumn('total_selling', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品销售总价']) + ->addColumn('reward_balance', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品奖励余额']) + ->addColumn('reward_integral', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品奖励积分']) + ->addColumn('stock_sales', 'integer', ['limit' => 20, 'default' => 1, 'null' => true, 'comment' => '包含商品数量']) + ->addColumn('vip_name', 'string', ['limit' => 30, 'default' => '', 'null' => true, 'comment' => '用户等级名称']) + ->addColumn('vip_code', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户等级序号']) + ->addColumn('vip_entry', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '是否入会礼包(0非礼包,1是礼包)']) + ->addColumn('vip_upgrade', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '升级用户等级']) + ->addColumn('truck_type', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '物流配送类型(0虚物,1实物)']) + ->addColumn('truck_code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '快递邮费模板']) + ->addColumn('truck_number', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '快递计费基数']) + ->addColumn('rebate_type', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '参与返利状态(0不返,1返利)']) + ->addColumn('rebate_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '参与返利金额']) + ->addColumn('discount_id', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '优惠方案编号']) + ->addColumn('discount_rate', 'decimal', ['precision' => 20, 'scale' => 6, 'default' => '100.000000', 'null' => true, 'comment' => '销售价格折扣']) + ->addColumn('discount_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品优惠金额']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '商品状态(1使用,0禁用)']) + ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '订单创建时间']) ->addIndex('status', ['name' => 'idx_shop_order_item_status']) ->addIndex('deleted', ['name' => 'idx_shop_order_item_deleted']) ->addIndex('order_no', ['name' => 'idx_shop_order_item_order_no']) @@ -1169,38 +1172,39 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-订单-配送', ]) - ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '商城用户编号']) - ->addColumn('order_no', 'string', ['limit' => 20, 'default' => '', 'comment' => '商城订单单号']) - ->addColumn('address_code', 'string', ['limit' => 20, 'default' => '', 'comment' => '配送地址编号']) - ->addColumn('address_name', 'string', ['limit' => 50, 'default' => '', 'comment' => '配送收货人姓名']) - ->addColumn('address_phone', 'string', ['limit' => 20, 'default' => '', 'comment' => '配送收货人手机']) - ->addColumn('address_idcode', 'string', ['limit' => 100, 'default' => '', 'comment' => '配送收货人证件号码']) - ->addColumn('address_idimg1', 'string', ['limit' => 500, 'default' => '', 'comment' => '配送收货人证件正面']) - ->addColumn('address_idimg2', 'string', ['limit' => 500, 'default' => '', 'comment' => '配送收货人证件反面']) - ->addColumn('address_province', 'string', ['limit' => 30, 'default' => '', 'comment' => '配送地址的省份']) - ->addColumn('address_city', 'string', ['limit' => 30, 'default' => '', 'comment' => '配送地址的城市']) - ->addColumn('address_area', 'string', ['limit' => 30, 'default' => '', 'comment' => '配送地址的区域']) - ->addColumn('address_content', 'string', ['limit' => 255, 'default' => '', 'comment' => '配送的详细地址']) - ->addColumn('address_datetime', 'string', ['limit' => 20, 'default' => '', 'comment' => '地址确认时间']) - ->addColumn('template_code', 'string', ['limit' => 20, 'default' => '', 'comment' => '配送模板编号']) - ->addColumn('template_count', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '快递计费基数']) - ->addColumn('template_remark', 'string', ['limit' => 255, 'default' => '', 'comment' => '配送计算描述']) - ->addColumn('template_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '配送计算金额']) - ->addColumn('company_code', 'string', ['limit' => 20, 'default' => '', 'comment' => '快递公司编码']) - ->addColumn('company_name', 'string', ['limit' => 100, 'default' => '', 'comment' => '快递公司名称']) - ->addColumn('send_number', 'string', ['limit' => 100, 'default' => '', 'comment' => '快递运送单号']) - ->addColumn('send_remark', 'string', ['limit' => 255, 'default' => '', 'comment' => '快递发送备注']) - ->addColumn('send_datetime', 'string', ['limit' => 20, 'default' => '', 'comment' => '快递发送时间']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '发货商品状态(1使用,0禁用)']) - ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '发货删除状态(0未删,1已删)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) - ->addIndex('uuid', ['name' => 'idx_shop_order_send_uuid']) + ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '商城用户编号']) + ->addColumn('order_no', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商城订单单号']) + ->addColumn('address_code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '配送地址编号']) + ->addColumn('address_name', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '配送收货人姓名']) + ->addColumn('address_phone', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '配送收货人手机']) + ->addColumn('address_idcode', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '配送收货人证件号码']) + ->addColumn('address_idimg1', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '配送收货人证件正面']) + ->addColumn('address_idimg2', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '配送收货人证件反面']) + ->addColumn('address_province', 'string', ['limit' => 30, 'default' => '', 'null' => true, 'comment' => '配送地址的省份']) + ->addColumn('address_city', 'string', ['limit' => 30, 'default' => '', 'null' => true, 'comment' => '配送地址的城市']) + ->addColumn('address_area', 'string', ['limit' => 30, 'default' => '', 'null' => true, 'comment' => '配送地址的区域']) + ->addColumn('address_content', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '配送的详细地址']) + ->addColumn('address_datetime', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '地址确认时间']) + ->addColumn('template_code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '配送模板编号']) + ->addColumn('template_count', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '快递计费基数']) + ->addColumn('template_remark', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '配送计算描述']) + ->addColumn('template_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '配送计算金额']) + ->addColumn('company_code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '快递公司编码']) + ->addColumn('company_name', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '快递公司名称']) + ->addColumn('send_number', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '快递运送单号']) + ->addColumn('send_remark', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '快递发送备注']) + ->addColumn('send_datetime', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '快递发送时间']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '发货商品状态(1使用,0禁用)']) + ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '发货删除状态(0未删,1已删)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('status', ['name' => 'idx_shop_order_send_status']) ->addIndex('deleted', ['name' => 'idx_shop_order_send_deleted']) ->addIndex('order_no', ['name' => 'idx_shop_order_send_order_no']) + ->addIndex('uuid', ['name' => 'idx_shop_order_send_uuid']) ->save(); // 修改主键长度 $this->table($table)->changeColumn('id', 'integer', ['limit' => 20, 'identity' => true]); } + } diff --git a/app/wechat/database/20221013045829_install_wechat.php b/app/wechat/database/20221013045829_install_wechat.php index 64cd9bf8d..f4d2ec8a2 100644 --- a/app/wechat/database/20221013045829_install_wechat.php +++ b/app/wechat/database/20221013045829_install_wechat.php @@ -37,24 +37,24 @@ class InstallWechat extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-回复', ]) - ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'comment' => '类型(text,image,news)']) - ->addColumn('time', 'string', ['limit' => 100, 'default' => '', 'comment' => '延迟时间']) - ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'comment' => '消息编号']) - ->addColumn('appid', 'string', ['limit' => 100, 'default' => '', 'comment' => '公众号APPID']) - ->addColumn('content', 'text', ['default' => null, 'comment' => '文本内容']) - ->addColumn('image_url', 'string', ['limit' => 255, 'default' => '', 'comment' => '图片链接']) - ->addColumn('voice_url', 'string', ['limit' => 255, 'default' => '', 'comment' => '语音链接']) - ->addColumn('music_title', 'string', ['limit' => 100, 'default' => '', 'comment' => '音乐标题']) - ->addColumn('music_url', 'string', ['limit' => 255, 'default' => '', 'comment' => '音乐链接']) - ->addColumn('music_image', 'string', ['limit' => 255, 'default' => '', 'comment' => '缩略图片']) - ->addColumn('music_desc', 'string', ['limit' => 255, 'default' => '', 'comment' => '音乐描述']) - ->addColumn('video_title', 'string', ['limit' => 100, 'default' => '', 'comment' => '视频标题']) - ->addColumn('video_url', 'string', ['limit' => 255, 'default' => '', 'comment' => '视频URL']) - ->addColumn('video_desc', 'string', ['limit' => 255, 'default' => '', 'comment' => '视频描述']) - ->addColumn('news_id', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '图文ID']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '状态(0禁用,1启用)']) - ->addColumn('create_by', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '创建人']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '类型(text,image,news)']) + ->addColumn('time', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '延迟时间']) + ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '消息编号']) + ->addColumn('appid', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '公众号APPID']) + ->addColumn('content', 'text', ['default' => null, 'null' => true, 'comment' => '文本内容']) + ->addColumn('image_url', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '图片链接']) + ->addColumn('voice_url', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '语音链接']) + ->addColumn('music_title', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '音乐标题']) + ->addColumn('music_url', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '音乐链接']) + ->addColumn('music_image', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '缩略图片']) + ->addColumn('music_desc', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '音乐描述']) + ->addColumn('video_title', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '视频标题']) + ->addColumn('video_url', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '视频URL']) + ->addColumn('video_desc', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '视频描述']) + ->addColumn('news_id', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '图文ID']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '状态(0禁用,1启用)']) + ->addColumn('create_by', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '创建人']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('type', ['name' => 'idx_wechat_auto_type']) ->addIndex('time', ['name' => 'idx_wechat_auto_time']) ->addIndex('code', ['name' => 'idx_wechat_auto_code']) @@ -84,26 +84,26 @@ class InstallWechat extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-粉丝', ]) - ->addColumn('appid', 'string', ['limit' => 50, 'default' => '', 'comment' => '公众号APPID']) - ->addColumn('unionid', 'string', ['limit' => 100, 'default' => '', 'comment' => '粉丝unionid']) - ->addColumn('openid', 'string', ['limit' => 100, 'default' => '', 'comment' => '粉丝openid']) - ->addColumn('tagid_list', 'string', ['limit' => 100, 'default' => '', 'comment' => '粉丝标签id']) - ->addColumn('is_black', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '是否为黑名单状态']) - ->addColumn('subscribe', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '关注状态(0未关注,1已关注)']) - ->addColumn('nickname', 'string', ['limit' => 200, 'default' => '', 'comment' => '用户昵称']) - ->addColumn('sex', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '用户性别(1男性,2女性,0未知)']) - ->addColumn('country', 'string', ['limit' => 50, 'default' => '', 'comment' => '用户所在国家']) - ->addColumn('province', 'string', ['limit' => 50, 'default' => '', 'comment' => '用户所在省份']) - ->addColumn('city', 'string', ['limit' => 50, 'default' => '', 'comment' => '用户所在城市']) - ->addColumn('language', 'string', ['limit' => 50, 'default' => '', 'comment' => '用户的语言(zh_CN)']) - ->addColumn('headimgurl', 'string', ['limit' => 500, 'default' => '', 'comment' => '用户头像']) - ->addColumn('subscribe_time', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '关注时间']) - ->addColumn('subscribe_at', 'datetime', ['default' => null, 'comment' => '关注时间']) - ->addColumn('remark', 'string', ['limit' => 50, 'default' => '', 'comment' => '备注']) - ->addColumn('subscribe_scene', 'string', ['limit' => 200, 'default' => '', 'comment' => '扫码关注场景']) - ->addColumn('qr_scene', 'string', ['limit' => 100, 'default' => '', 'comment' => '二维码场景值']) - ->addColumn('qr_scene_str', 'string', ['limit' => 200, 'default' => '', 'comment' => '二维码场景内容']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('appid', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '公众号APPID']) + ->addColumn('unionid', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '粉丝unionid']) + ->addColumn('openid', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '粉丝openid']) + ->addColumn('tagid_list', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '粉丝标签id']) + ->addColumn('is_black', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '是否为黑名单状态']) + ->addColumn('subscribe', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '关注状态(0未关注,1已关注)']) + ->addColumn('nickname', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '用户昵称']) + ->addColumn('sex', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '用户性别(1男性,2女性,0未知)']) + ->addColumn('country', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '用户所在国家']) + ->addColumn('province', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '用户所在省份']) + ->addColumn('city', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '用户所在城市']) + ->addColumn('language', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '用户的语言(zh_CN)']) + ->addColumn('headimgurl', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '用户头像']) + ->addColumn('subscribe_time', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '关注时间']) + ->addColumn('subscribe_at', 'datetime', ['default' => null, 'null' => true, 'comment' => '关注时间']) + ->addColumn('remark', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '备注']) + ->addColumn('subscribe_scene', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '扫码关注场景']) + ->addColumn('qr_scene', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '二维码场景值']) + ->addColumn('qr_scene_str', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '二维码场景内容']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('openid', ['name' => 'idx_wechat_fans_openid']) ->addIndex('unionid', ['name' => 'idx_wechat_fans_unionid']) ->addIndex('is_black', ['name' => 'idx_wechat_fans_is_black']) @@ -133,10 +133,10 @@ class InstallWechat extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-标签', ]) - ->addColumn('appid', 'string', ['limit' => 50, 'default' => '', 'comment' => '公众号APPID']) - ->addColumn('name', 'string', ['limit' => 35, 'default' => '', 'comment' => '标签名称']) - ->addColumn('count', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '总数']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建日期']) + ->addColumn('appid', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '公众号APPID']) + ->addColumn('name', 'string', ['limit' => 35, 'default' => '', 'null' => true, 'comment' => '标签名称']) + ->addColumn('count', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '总数']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建日期']) ->addIndex('id', ['name' => 'idx_wechat_fans_tags_id']) ->addIndex('appid', ['name' => 'idx_wechat_fans_tags_appid']) ->save(); @@ -164,24 +164,24 @@ class InstallWechat extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-规则', ]) - ->addColumn('appid', 'string', ['limit' => 100, 'default' => '', 'comment' => '公众号APPID']) - ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'comment' => '类型(text,image,news)']) - ->addColumn('keys', 'string', ['limit' => 100, 'default' => '', 'comment' => '关键字']) - ->addColumn('content', 'text', ['default' => null, 'comment' => '文本内容']) - ->addColumn('image_url', 'string', ['limit' => 255, 'default' => '', 'comment' => '图片链接']) - ->addColumn('voice_url', 'string', ['limit' => 255, 'default' => '', 'comment' => '语音链接']) - ->addColumn('music_title', 'string', ['limit' => 100, 'default' => '', 'comment' => '音乐标题']) - ->addColumn('music_url', 'string', ['limit' => 255, 'default' => '', 'comment' => '音乐链接']) - ->addColumn('music_image', 'string', ['limit' => 255, 'default' => '', 'comment' => '缩略图片']) - ->addColumn('music_desc', 'string', ['limit' => 255, 'default' => '', 'comment' => '音乐描述']) - ->addColumn('video_title', 'string', ['limit' => 100, 'default' => '', 'comment' => '视频标题']) - ->addColumn('video_url', 'string', ['limit' => 255, 'default' => '', 'comment' => '视频URL']) - ->addColumn('video_desc', 'string', ['limit' => 255, 'default' => '', 'comment' => '视频描述']) - ->addColumn('news_id', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '图文ID']) - ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '排序字段']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '状态(0禁用,1启用)']) - ->addColumn('create_by', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '创建人']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('appid', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '公众号APPID']) + ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '类型(text,image,news)']) + ->addColumn('keys', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '关键字']) + ->addColumn('content', 'text', ['default' => null, 'null' => true, 'comment' => '文本内容']) + ->addColumn('image_url', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '图片链接']) + ->addColumn('voice_url', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '语音链接']) + ->addColumn('music_title', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '音乐标题']) + ->addColumn('music_url', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '音乐链接']) + ->addColumn('music_image', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '缩略图片']) + ->addColumn('music_desc', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '音乐描述']) + ->addColumn('video_title', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '视频标题']) + ->addColumn('video_url', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '视频URL']) + ->addColumn('video_desc', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '视频描述']) + ->addColumn('news_id', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '图文ID']) + ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序字段']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '状态(0禁用,1启用)']) + ->addColumn('create_by', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '创建人']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('appid', ['name' => 'idx_wechat_keys_appid']) ->addIndex('type', ['name' => 'idx_wechat_keys_type']) ->addIndex('keys', ['name' => 'idx_wechat_keys_keys']) @@ -210,13 +210,13 @@ class InstallWechat extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-素材', ]) - ->addColumn('md5', 'string', ['limit' => 32, 'default' => '', 'comment' => '文件md5']) - ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'comment' => '媒体类型']) - ->addColumn('appid', 'string', ['limit' => 100, 'default' => '', 'comment' => '公众号ID']) - ->addColumn('media_id', 'string', ['limit' => 100, 'default' => '', 'comment' => '永久素材MediaID']) - ->addColumn('local_url', 'string', ['limit' => 300, 'default' => '', 'comment' => '本地文件链接']) - ->addColumn('media_url', 'string', ['limit' => 300, 'default' => '', 'comment' => '远程图片链接']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('md5', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '文件md5']) + ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '媒体类型']) + ->addColumn('appid', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '公众号ID']) + ->addColumn('media_id', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '永久素材MediaID']) + ->addColumn('local_url', 'string', ['limit' => 300, 'default' => '', 'null' => true, 'comment' => '本地文件链接']) + ->addColumn('media_url', 'string', ['limit' => 300, 'default' => '', 'null' => true, 'comment' => '远程图片链接']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('appid', ['name' => 'idx_wechat_media_appid']) ->addIndex('md5', ['name' => 'idx_wechat_media_md5']) ->addIndex('type', ['name' => 'idx_wechat_media_type']) @@ -246,12 +246,12 @@ class InstallWechat extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-图文', ]) - ->addColumn('media_id', 'string', ['limit' => 100, 'default' => '', 'comment' => '永久素材MediaID']) - ->addColumn('local_url', 'string', ['limit' => 300, 'default' => '', 'comment' => '永久素材外网URL']) - ->addColumn('article_id', 'string', ['limit' => 60, 'default' => '', 'comment' => '关联图文ID(用英文逗号做分割)']) - ->addColumn('is_deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态(0未删除,1已删除)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) - ->addColumn('create_by', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '创建人']) + ->addColumn('media_id', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '永久素材MediaID']) + ->addColumn('local_url', 'string', ['limit' => 300, 'default' => '', 'null' => true, 'comment' => '永久素材外网URL']) + ->addColumn('article_id', 'string', ['limit' => 60, 'default' => '', 'null' => true, 'comment' => '关联图文ID(用英文逗号做分割)']) + ->addColumn('is_deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删除,1已删除)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) + ->addColumn('create_by', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '创建人']) ->addIndex('article_id', ['name' => 'idx_wechat_news_article_id']) ->addIndex('media_id', ['name' => 'idx_wechat_news_media_id']) ->save(); @@ -279,15 +279,15 @@ class InstallWechat extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-文章', ]) - ->addColumn('title', 'string', ['limit' => 50, 'default' => '', 'comment' => '素材标题']) - ->addColumn('local_url', 'string', ['limit' => 300, 'default' => '', 'comment' => '永久素材显示URL']) - ->addColumn('show_cover_pic', 'integer', ['limit' => 4, 'default' => 0, 'comment' => '显示封面(0不显示,1显示)']) - ->addColumn('author', 'string', ['limit' => 20, 'default' => '', 'comment' => '文章作者']) - ->addColumn('digest', 'string', ['limit' => 300, 'default' => '', 'comment' => '摘要内容']) - ->addColumn('content', 'text', ['default' => null, 'comment' => '图文内容']) - ->addColumn('content_source_url', 'string', ['limit' => 200, 'default' => '', 'comment' => '原文地址']) - ->addColumn('read_num', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '阅读数量']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('title', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '素材标题']) + ->addColumn('local_url', 'string', ['limit' => 300, 'default' => '', 'null' => true, 'comment' => '永久素材显示URL']) + ->addColumn('show_cover_pic', 'integer', ['limit' => 4, 'default' => 0, 'null' => true, 'comment' => '显示封面(0不显示,1显示)']) + ->addColumn('author', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '文章作者']) + ->addColumn('digest', 'string', ['limit' => 300, 'default' => '', 'null' => true, 'comment' => '摘要内容']) + ->addColumn('content', 'text', ['default' => null, 'null' => true, 'comment' => '图文内容']) + ->addColumn('content_source_url', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '原文地址']) + ->addColumn('read_num', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '阅读数量']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->save(); // 修改主键长度 diff --git a/database/migrations/20221013031925_install_admin.php b/database/migrations/20221013031925_install_admin.php index 134a85c86..77473401e 100644 --- a/database/migrations/20221013031925_install_admin.php +++ b/database/migrations/20221013031925_install_admin.php @@ -40,12 +40,12 @@ class InstallAdmin extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-权限', ]) - ->addColumn('title', 'string', ['limit' => 100, 'default' => '', 'comment' => '权限名称']) - ->addColumn('utype', 'string', ['limit' => 50, 'default' => '', 'comment' => '身份权限']) - ->addColumn('desc', 'string', ['limit' => 500, 'default' => '', 'comment' => '备注说明']) - ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '排序权重']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '权限状态(1使用,0禁用)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('title', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '权限名称']) + ->addColumn('utype', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '身份权限']) + ->addColumn('desc', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '备注说明']) + ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '权限状态(1使用,0禁用)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('status', ['name' => 'idx_system_auth_status']) ->addIndex('title', ['name' => 'idx_system_auth_title']) ->save(); @@ -73,8 +73,8 @@ class InstallAdmin extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-授权', ]) - ->addColumn('auth', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '角色']) - ->addColumn('node', 'string', ['limit' => 200, 'default' => '', 'comment' => '节点']) + ->addColumn('auth', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '角色']) + ->addColumn('node', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '节点']) ->addIndex('auth', ['name' => 'idx_system_auth_node_auth']) ->addIndex('node', ['name' => 'idx_system_auth_node_node']) ->save(); @@ -102,16 +102,16 @@ class InstallAdmin extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-字典', ]) - ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'comment' => '数据类型']) - ->addColumn('code', 'string', ['limit' => 100, 'default' => '', 'comment' => '数据代码']) - ->addColumn('name', 'string', ['limit' => 500, 'default' => '', 'comment' => '数据名称']) - ->addColumn('content', 'text', ['default' => null, 'comment' => '数据内容']) - ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '排序权重']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '数据状态(0禁用,1启动)']) - ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态(0正常,1已删)']) - ->addColumn('deleted_at', 'string', ['limit' => 20, 'default' => '', 'comment' => '删除时间']) - ->addColumn('deleted_by', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '删除用户']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '数据类型']) + ->addColumn('code', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '数据代码']) + ->addColumn('name', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '数据名称']) + ->addColumn('content', 'text', ['default' => null, 'null' => true, 'comment' => '数据内容']) + ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '数据状态(0禁用,1启动)']) + ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0正常,1已删)']) + ->addColumn('deleted_at', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '删除时间']) + ->addColumn('deleted_by', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '删除用户']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('type', ['name' => 'idx_system_base_type']) ->addIndex('code', ['name' => 'idx_system_base_code']) ->addIndex('name', ['name' => 'idx_system_base_name']) @@ -140,9 +140,9 @@ class InstallAdmin extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-配置', ]) - ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'comment' => '配置分类']) - ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'comment' => '配置名称']) - ->addColumn('value', 'string', ['limit' => 2048, 'default' => '', 'comment' => '配置内容']) + ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '配置分类']) + ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '配置名称']) + ->addColumn('value', 'string', ['limit' => 2048, 'default' => '', 'null' => true, 'comment' => '配置内容']) ->addIndex('type', ['name' => 'idx_system_config_type']) ->addIndex('name', ['name' => 'idx_system_config_name']) ->save(); @@ -170,8 +170,8 @@ class InstallAdmin extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-数据', ]) - ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'comment' => '配置名']) - ->addColumn('value', 'text', ['default' => null, 'comment' => '配置值']) + ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '配置名']) + ->addColumn('value', 'text', ['default' => null, 'null' => true, 'comment' => '配置值']) ->addIndex('name', ['name' => 'idx_system_data_name']) ->save(); @@ -198,20 +198,20 @@ class InstallAdmin extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-文件', ]) - ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'comment' => '上传类型']) - ->addColumn('hash', 'string', ['limit' => 32, 'default' => '', 'comment' => '文件哈希']) - ->addColumn('name', 'string', ['limit' => 200, 'default' => '', 'comment' => '文件名称']) - ->addColumn('xext', 'string', ['limit' => 100, 'default' => '', 'comment' => '文件后缀']) - ->addColumn('xurl', 'string', ['limit' => 500, 'default' => '', 'comment' => '访问链接']) - ->addColumn('xkey', 'string', ['limit' => 500, 'default' => '', 'comment' => '文件路径']) - ->addColumn('mime', 'string', ['limit' => 100, 'default' => '', 'comment' => '文件类型']) - ->addColumn('size', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '文件大小']) - ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '用户编号']) - ->addColumn('isfast', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '是否秒传']) - ->addColumn('issafe', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '安全模式']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '上传状态(1悬空,2落地)']) - ->addColumn('create_at', 'datetime', ['default' => null, 'comment' => '创建时间']) - ->addColumn('update_at', 'datetime', ['default' => null, 'comment' => '更新时间']) + ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '上传类型']) + ->addColumn('hash', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '文件哈希']) + ->addColumn('name', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '文件名称']) + ->addColumn('xext', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '文件后缀']) + ->addColumn('xurl', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '访问链接']) + ->addColumn('xkey', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '文件路径']) + ->addColumn('mime', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '文件类型']) + ->addColumn('size', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '文件大小']) + ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户编号']) + ->addColumn('isfast', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '是否秒传']) + ->addColumn('issafe', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '安全模式']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '上传状态(1悬空,2落地)']) + ->addColumn('create_at', 'datetime', ['default' => null, 'null' => true, 'comment' => '创建时间']) + ->addColumn('update_at', 'datetime', ['default' => null, 'null' => true, 'comment' => '更新时间']) ->addIndex('type', ['name' => 'idx_system_file_type']) ->addIndex('hash', ['name' => 'idx_system_file_hash']) ->addIndex('uuid', ['name' => 'idx_system_file_uuid']) @@ -244,16 +244,16 @@ class InstallAdmin extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-菜单', ]) - ->addColumn('pid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '上级ID']) - ->addColumn('title', 'string', ['limit' => 100, 'default' => '', 'comment' => '菜单名称']) - ->addColumn('icon', 'string', ['limit' => 100, 'default' => '', 'comment' => '菜单图标']) - ->addColumn('node', 'string', ['limit' => 100, 'default' => '', 'comment' => '节点代码']) - ->addColumn('url', 'string', ['limit' => 400, 'default' => '', 'comment' => '链接节点']) - ->addColumn('params', 'string', ['limit' => 500, 'default' => '', 'comment' => '链接参数']) - ->addColumn('target', 'string', ['limit' => 20, 'default' => '_self', 'comment' => '打开方式']) - ->addColumn('sort', 'integer', ['limit' => 11, 'default' => 0, 'comment' => '排序权重']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '状态(0:禁用,1:启用)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('pid', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '上级ID']) + ->addColumn('title', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '菜单名称']) + ->addColumn('icon', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '菜单图标']) + ->addColumn('node', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '节点代码']) + ->addColumn('url', 'string', ['limit' => 400, 'default' => '', 'null' => true, 'comment' => '链接节点']) + ->addColumn('params', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '链接参数']) + ->addColumn('target', 'string', ['limit' => 20, 'default' => '_self', 'null' => true, 'comment' => '打开方式']) + ->addColumn('sort', 'integer', ['limit' => 11, 'default' => 0, 'null' => true, 'comment' => '排序权重']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '状态(0:禁用,1:启用)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('status', ['name' => 'idx_system_menu_status']) ->save(); @@ -280,12 +280,12 @@ class InstallAdmin extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-日志', ]) - ->addColumn('node', 'string', ['limit' => 200, 'default' => '', 'comment' => '当前操作节点']) - ->addColumn('geoip', 'string', ['limit' => 15, 'default' => '', 'comment' => '操作者IP地址']) - ->addColumn('action', 'string', ['limit' => 200, 'default' => '', 'comment' => '操作行为名称']) - ->addColumn('content', 'string', ['limit' => 1024, 'default' => '', 'comment' => '操作内容描述']) - ->addColumn('username', 'string', ['limit' => 50, 'default' => '', 'comment' => '操作人用户名']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('node', 'string', ['limit' => 200, 'default' => '', 'null' => false, 'comment' => '当前操作节点']) + ->addColumn('geoip', 'string', ['limit' => 15, 'default' => '', 'null' => false, 'comment' => '操作者IP地址']) + ->addColumn('action', 'string', ['limit' => 200, 'default' => '', 'null' => false, 'comment' => '操作行为名称']) + ->addColumn('content', 'string', ['limit' => 1024, 'default' => '', 'null' => false, 'comment' => '操作内容描述']) + ->addColumn('username', 'string', ['limit' => 50, 'default' => '', 'null' => false, 'comment' => '操作人用户名']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => false, 'comment' => '创建时间']) ->save(); // 修改主键长度 @@ -311,20 +311,20 @@ class InstallAdmin extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-任务', ]) - ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'comment' => '任务编号']) - ->addColumn('title', 'string', ['limit' => 100, 'default' => '', 'comment' => '任务名称']) - ->addColumn('command', 'string', ['limit' => 500, 'default' => '', 'comment' => '执行指令']) - ->addColumn('exec_pid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '执行进程']) - ->addColumn('exec_data', 'text', ['default' => null, 'comment' => '执行参数']) - ->addColumn('exec_time', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '执行时间']) - ->addColumn('exec_desc', 'string', ['limit' => 500, 'default' => '', 'comment' => '执行描述']) - ->addColumn('enter_time', 'decimal', ['precision' => 20, 'scale' => 4, 'default' => '0.0000', 'comment' => '开始时间']) - ->addColumn('outer_time', 'decimal', ['precision' => 20, 'scale' => 4, 'default' => '0.0000', 'comment' => '结束时间']) - ->addColumn('loops_time', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '循环时间']) - ->addColumn('attempts', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '执行次数']) - ->addColumn('rscript', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '任务类型(0单例,1多例)']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '任务状态(1新任务,2处理中,3成功,4失败)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'null' => false, 'comment' => '任务编号']) + ->addColumn('title', 'string', ['limit' => 100, 'default' => '', 'null' => false, 'comment' => '任务名称']) + ->addColumn('command', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '执行指令']) + ->addColumn('exec_pid', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '执行进程']) + ->addColumn('exec_data', 'text', ['default' => null, 'null' => true, 'comment' => '执行参数']) + ->addColumn('exec_time', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '执行时间']) + ->addColumn('exec_desc', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '执行描述']) + ->addColumn('enter_time', 'decimal', ['precision' => 20, 'scale' => 4, 'default' => '0.0000', 'null' => true, 'comment' => '开始时间']) + ->addColumn('outer_time', 'decimal', ['precision' => 20, 'scale' => 4, 'default' => '0.0000', 'null' => true, 'comment' => '结束时间']) + ->addColumn('loops_time', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '循环时间']) + ->addColumn('attempts', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '执行次数']) + ->addColumn('rscript', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '任务类型(0单例,1多例)']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '任务状态(1新任务,2处理中,3成功,4失败)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => false, 'comment' => '创建时间']) ->addIndex('code', ['name' => 'idx_system_queue_code']) ->addIndex('title', ['name' => 'idx_system_queue_title']) ->addIndex('status', ['name' => 'idx_system_queue_status']) @@ -356,23 +356,23 @@ class InstallAdmin extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '系统-用户', ]) - ->addColumn('usertype', 'string', ['limit' => 20, 'default' => '', 'comment' => '用户类型']) - ->addColumn('username', 'string', ['limit' => 50, 'default' => '', 'comment' => '用户账号']) - ->addColumn('password', 'string', ['limit' => 32, 'default' => '', 'comment' => '用户密码']) - ->addColumn('nickname', 'string', ['limit' => 50, 'default' => '', 'comment' => '用户昵称']) - ->addColumn('headimg', 'string', ['limit' => 255, 'default' => '', 'comment' => '头像地址']) - ->addColumn('authorize', 'string', ['limit' => 255, 'default' => '', 'comment' => '权限授权']) - ->addColumn('contact_qq', 'string', ['limit' => 20, 'default' => '', 'comment' => '联系QQ']) - ->addColumn('contact_mail', 'string', ['limit' => 20, 'default' => '', 'comment' => '联系邮箱']) - ->addColumn('contact_phone', 'string', ['limit' => 20, 'default' => '', 'comment' => '联系手机']) - ->addColumn('login_ip', 'string', ['limit' => 255, 'default' => '', 'comment' => '登录地址']) - ->addColumn('login_at', 'string', ['limit' => 20, 'default' => '', 'comment' => '登录时间']) - ->addColumn('login_num', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '登录次数']) - ->addColumn('describe', 'string', ['limit' => 255, 'default' => '', 'comment' => '备注说明']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '状态(0禁用,1启用)']) - ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '排序权重']) - ->addColumn('is_deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除(1删除,0未删)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('usertype', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '用户类型']) + ->addColumn('username', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '用户账号']) + ->addColumn('password', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '用户密码']) + ->addColumn('nickname', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '用户昵称']) + ->addColumn('headimg', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '头像地址']) + ->addColumn('authorize', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '权限授权']) + ->addColumn('contact_qq', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '联系QQ']) + ->addColumn('contact_mail', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '联系邮箱']) + ->addColumn('contact_phone', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '联系手机']) + ->addColumn('login_ip', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '登录地址']) + ->addColumn('login_at', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '登录时间']) + ->addColumn('login_num', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '登录次数']) + ->addColumn('describe', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '备注说明']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '状态(0禁用,1启用)']) + ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) + ->addColumn('is_deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除(1删除,0未删)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('status', ['name' => 'idx_system_user_status']) ->addIndex('username', ['name' => 'idx_system_user_username']) ->addIndex('is_deleted', ['name' => 'idx_system_user_is_deleted']) diff --git a/database/migrations/20221013045829_install_wechat.php b/database/migrations/20221013045829_install_wechat.php index 64cd9bf8d..f4d2ec8a2 100644 --- a/database/migrations/20221013045829_install_wechat.php +++ b/database/migrations/20221013045829_install_wechat.php @@ -37,24 +37,24 @@ class InstallWechat extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-回复', ]) - ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'comment' => '类型(text,image,news)']) - ->addColumn('time', 'string', ['limit' => 100, 'default' => '', 'comment' => '延迟时间']) - ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'comment' => '消息编号']) - ->addColumn('appid', 'string', ['limit' => 100, 'default' => '', 'comment' => '公众号APPID']) - ->addColumn('content', 'text', ['default' => null, 'comment' => '文本内容']) - ->addColumn('image_url', 'string', ['limit' => 255, 'default' => '', 'comment' => '图片链接']) - ->addColumn('voice_url', 'string', ['limit' => 255, 'default' => '', 'comment' => '语音链接']) - ->addColumn('music_title', 'string', ['limit' => 100, 'default' => '', 'comment' => '音乐标题']) - ->addColumn('music_url', 'string', ['limit' => 255, 'default' => '', 'comment' => '音乐链接']) - ->addColumn('music_image', 'string', ['limit' => 255, 'default' => '', 'comment' => '缩略图片']) - ->addColumn('music_desc', 'string', ['limit' => 255, 'default' => '', 'comment' => '音乐描述']) - ->addColumn('video_title', 'string', ['limit' => 100, 'default' => '', 'comment' => '视频标题']) - ->addColumn('video_url', 'string', ['limit' => 255, 'default' => '', 'comment' => '视频URL']) - ->addColumn('video_desc', 'string', ['limit' => 255, 'default' => '', 'comment' => '视频描述']) - ->addColumn('news_id', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '图文ID']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '状态(0禁用,1启用)']) - ->addColumn('create_by', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '创建人']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '类型(text,image,news)']) + ->addColumn('time', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '延迟时间']) + ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '消息编号']) + ->addColumn('appid', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '公众号APPID']) + ->addColumn('content', 'text', ['default' => null, 'null' => true, 'comment' => '文本内容']) + ->addColumn('image_url', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '图片链接']) + ->addColumn('voice_url', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '语音链接']) + ->addColumn('music_title', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '音乐标题']) + ->addColumn('music_url', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '音乐链接']) + ->addColumn('music_image', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '缩略图片']) + ->addColumn('music_desc', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '音乐描述']) + ->addColumn('video_title', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '视频标题']) + ->addColumn('video_url', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '视频URL']) + ->addColumn('video_desc', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '视频描述']) + ->addColumn('news_id', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '图文ID']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '状态(0禁用,1启用)']) + ->addColumn('create_by', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '创建人']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('type', ['name' => 'idx_wechat_auto_type']) ->addIndex('time', ['name' => 'idx_wechat_auto_time']) ->addIndex('code', ['name' => 'idx_wechat_auto_code']) @@ -84,26 +84,26 @@ class InstallWechat extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-粉丝', ]) - ->addColumn('appid', 'string', ['limit' => 50, 'default' => '', 'comment' => '公众号APPID']) - ->addColumn('unionid', 'string', ['limit' => 100, 'default' => '', 'comment' => '粉丝unionid']) - ->addColumn('openid', 'string', ['limit' => 100, 'default' => '', 'comment' => '粉丝openid']) - ->addColumn('tagid_list', 'string', ['limit' => 100, 'default' => '', 'comment' => '粉丝标签id']) - ->addColumn('is_black', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '是否为黑名单状态']) - ->addColumn('subscribe', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '关注状态(0未关注,1已关注)']) - ->addColumn('nickname', 'string', ['limit' => 200, 'default' => '', 'comment' => '用户昵称']) - ->addColumn('sex', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '用户性别(1男性,2女性,0未知)']) - ->addColumn('country', 'string', ['limit' => 50, 'default' => '', 'comment' => '用户所在国家']) - ->addColumn('province', 'string', ['limit' => 50, 'default' => '', 'comment' => '用户所在省份']) - ->addColumn('city', 'string', ['limit' => 50, 'default' => '', 'comment' => '用户所在城市']) - ->addColumn('language', 'string', ['limit' => 50, 'default' => '', 'comment' => '用户的语言(zh_CN)']) - ->addColumn('headimgurl', 'string', ['limit' => 500, 'default' => '', 'comment' => '用户头像']) - ->addColumn('subscribe_time', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '关注时间']) - ->addColumn('subscribe_at', 'datetime', ['default' => null, 'comment' => '关注时间']) - ->addColumn('remark', 'string', ['limit' => 50, 'default' => '', 'comment' => '备注']) - ->addColumn('subscribe_scene', 'string', ['limit' => 200, 'default' => '', 'comment' => '扫码关注场景']) - ->addColumn('qr_scene', 'string', ['limit' => 100, 'default' => '', 'comment' => '二维码场景值']) - ->addColumn('qr_scene_str', 'string', ['limit' => 200, 'default' => '', 'comment' => '二维码场景内容']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('appid', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '公众号APPID']) + ->addColumn('unionid', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '粉丝unionid']) + ->addColumn('openid', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '粉丝openid']) + ->addColumn('tagid_list', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '粉丝标签id']) + ->addColumn('is_black', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '是否为黑名单状态']) + ->addColumn('subscribe', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '关注状态(0未关注,1已关注)']) + ->addColumn('nickname', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '用户昵称']) + ->addColumn('sex', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '用户性别(1男性,2女性,0未知)']) + ->addColumn('country', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '用户所在国家']) + ->addColumn('province', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '用户所在省份']) + ->addColumn('city', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '用户所在城市']) + ->addColumn('language', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '用户的语言(zh_CN)']) + ->addColumn('headimgurl', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '用户头像']) + ->addColumn('subscribe_time', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '关注时间']) + ->addColumn('subscribe_at', 'datetime', ['default' => null, 'null' => true, 'comment' => '关注时间']) + ->addColumn('remark', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '备注']) + ->addColumn('subscribe_scene', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '扫码关注场景']) + ->addColumn('qr_scene', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '二维码场景值']) + ->addColumn('qr_scene_str', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '二维码场景内容']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('openid', ['name' => 'idx_wechat_fans_openid']) ->addIndex('unionid', ['name' => 'idx_wechat_fans_unionid']) ->addIndex('is_black', ['name' => 'idx_wechat_fans_is_black']) @@ -133,10 +133,10 @@ class InstallWechat extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-标签', ]) - ->addColumn('appid', 'string', ['limit' => 50, 'default' => '', 'comment' => '公众号APPID']) - ->addColumn('name', 'string', ['limit' => 35, 'default' => '', 'comment' => '标签名称']) - ->addColumn('count', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '总数']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建日期']) + ->addColumn('appid', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '公众号APPID']) + ->addColumn('name', 'string', ['limit' => 35, 'default' => '', 'null' => true, 'comment' => '标签名称']) + ->addColumn('count', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '总数']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建日期']) ->addIndex('id', ['name' => 'idx_wechat_fans_tags_id']) ->addIndex('appid', ['name' => 'idx_wechat_fans_tags_appid']) ->save(); @@ -164,24 +164,24 @@ class InstallWechat extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-规则', ]) - ->addColumn('appid', 'string', ['limit' => 100, 'default' => '', 'comment' => '公众号APPID']) - ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'comment' => '类型(text,image,news)']) - ->addColumn('keys', 'string', ['limit' => 100, 'default' => '', 'comment' => '关键字']) - ->addColumn('content', 'text', ['default' => null, 'comment' => '文本内容']) - ->addColumn('image_url', 'string', ['limit' => 255, 'default' => '', 'comment' => '图片链接']) - ->addColumn('voice_url', 'string', ['limit' => 255, 'default' => '', 'comment' => '语音链接']) - ->addColumn('music_title', 'string', ['limit' => 100, 'default' => '', 'comment' => '音乐标题']) - ->addColumn('music_url', 'string', ['limit' => 255, 'default' => '', 'comment' => '音乐链接']) - ->addColumn('music_image', 'string', ['limit' => 255, 'default' => '', 'comment' => '缩略图片']) - ->addColumn('music_desc', 'string', ['limit' => 255, 'default' => '', 'comment' => '音乐描述']) - ->addColumn('video_title', 'string', ['limit' => 100, 'default' => '', 'comment' => '视频标题']) - ->addColumn('video_url', 'string', ['limit' => 255, 'default' => '', 'comment' => '视频URL']) - ->addColumn('video_desc', 'string', ['limit' => 255, 'default' => '', 'comment' => '视频描述']) - ->addColumn('news_id', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '图文ID']) - ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '排序字段']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '状态(0禁用,1启用)']) - ->addColumn('create_by', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '创建人']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('appid', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '公众号APPID']) + ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '类型(text,image,news)']) + ->addColumn('keys', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '关键字']) + ->addColumn('content', 'text', ['default' => null, 'null' => true, 'comment' => '文本内容']) + ->addColumn('image_url', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '图片链接']) + ->addColumn('voice_url', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '语音链接']) + ->addColumn('music_title', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '音乐标题']) + ->addColumn('music_url', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '音乐链接']) + ->addColumn('music_image', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '缩略图片']) + ->addColumn('music_desc', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '音乐描述']) + ->addColumn('video_title', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '视频标题']) + ->addColumn('video_url', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '视频URL']) + ->addColumn('video_desc', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '视频描述']) + ->addColumn('news_id', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '图文ID']) + ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序字段']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '状态(0禁用,1启用)']) + ->addColumn('create_by', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '创建人']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('appid', ['name' => 'idx_wechat_keys_appid']) ->addIndex('type', ['name' => 'idx_wechat_keys_type']) ->addIndex('keys', ['name' => 'idx_wechat_keys_keys']) @@ -210,13 +210,13 @@ class InstallWechat extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-素材', ]) - ->addColumn('md5', 'string', ['limit' => 32, 'default' => '', 'comment' => '文件md5']) - ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'comment' => '媒体类型']) - ->addColumn('appid', 'string', ['limit' => 100, 'default' => '', 'comment' => '公众号ID']) - ->addColumn('media_id', 'string', ['limit' => 100, 'default' => '', 'comment' => '永久素材MediaID']) - ->addColumn('local_url', 'string', ['limit' => 300, 'default' => '', 'comment' => '本地文件链接']) - ->addColumn('media_url', 'string', ['limit' => 300, 'default' => '', 'comment' => '远程图片链接']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('md5', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '文件md5']) + ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '媒体类型']) + ->addColumn('appid', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '公众号ID']) + ->addColumn('media_id', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '永久素材MediaID']) + ->addColumn('local_url', 'string', ['limit' => 300, 'default' => '', 'null' => true, 'comment' => '本地文件链接']) + ->addColumn('media_url', 'string', ['limit' => 300, 'default' => '', 'null' => true, 'comment' => '远程图片链接']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('appid', ['name' => 'idx_wechat_media_appid']) ->addIndex('md5', ['name' => 'idx_wechat_media_md5']) ->addIndex('type', ['name' => 'idx_wechat_media_type']) @@ -246,12 +246,12 @@ class InstallWechat extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-图文', ]) - ->addColumn('media_id', 'string', ['limit' => 100, 'default' => '', 'comment' => '永久素材MediaID']) - ->addColumn('local_url', 'string', ['limit' => 300, 'default' => '', 'comment' => '永久素材外网URL']) - ->addColumn('article_id', 'string', ['limit' => 60, 'default' => '', 'comment' => '关联图文ID(用英文逗号做分割)']) - ->addColumn('is_deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态(0未删除,1已删除)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) - ->addColumn('create_by', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '创建人']) + ->addColumn('media_id', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '永久素材MediaID']) + ->addColumn('local_url', 'string', ['limit' => 300, 'default' => '', 'null' => true, 'comment' => '永久素材外网URL']) + ->addColumn('article_id', 'string', ['limit' => 60, 'default' => '', 'null' => true, 'comment' => '关联图文ID(用英文逗号做分割)']) + ->addColumn('is_deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删除,1已删除)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) + ->addColumn('create_by', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '创建人']) ->addIndex('article_id', ['name' => 'idx_wechat_news_article_id']) ->addIndex('media_id', ['name' => 'idx_wechat_news_media_id']) ->save(); @@ -279,15 +279,15 @@ class InstallWechat extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '微信-文章', ]) - ->addColumn('title', 'string', ['limit' => 50, 'default' => '', 'comment' => '素材标题']) - ->addColumn('local_url', 'string', ['limit' => 300, 'default' => '', 'comment' => '永久素材显示URL']) - ->addColumn('show_cover_pic', 'integer', ['limit' => 4, 'default' => 0, 'comment' => '显示封面(0不显示,1显示)']) - ->addColumn('author', 'string', ['limit' => 20, 'default' => '', 'comment' => '文章作者']) - ->addColumn('digest', 'string', ['limit' => 300, 'default' => '', 'comment' => '摘要内容']) - ->addColumn('content', 'text', ['default' => null, 'comment' => '图文内容']) - ->addColumn('content_source_url', 'string', ['limit' => 200, 'default' => '', 'comment' => '原文地址']) - ->addColumn('read_num', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '阅读数量']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('title', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '素材标题']) + ->addColumn('local_url', 'string', ['limit' => 300, 'default' => '', 'null' => true, 'comment' => '永久素材显示URL']) + ->addColumn('show_cover_pic', 'integer', ['limit' => 4, 'default' => 0, 'null' => true, 'comment' => '显示封面(0不显示,1显示)']) + ->addColumn('author', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '文章作者']) + ->addColumn('digest', 'string', ['limit' => 300, 'default' => '', 'null' => true, 'comment' => '摘要内容']) + ->addColumn('content', 'text', ['default' => null, 'null' => true, 'comment' => '图文内容']) + ->addColumn('content_source_url', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '原文地址']) + ->addColumn('read_num', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '阅读数量']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->save(); // 修改主键长度 diff --git a/database/migrations/20221013045838_install_user.php b/database/migrations/20221013045838_install_user.php index debf2f86c..6529d15f3 100644 --- a/database/migrations/20221013045838_install_user.php +++ b/database/migrations/20221013045838_install_user.php @@ -7,6 +7,9 @@ use think\migration\Migrator; */ class InstallUser extends Migrator { + /** + * 创建数据库 + */ public function change() { $this->_create_base_postage_company(); @@ -57,15 +60,15 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-快递-公司', ]) - ->addColumn('name', 'string', ['limit' => 50, 'default' => '', 'comment' => '快递公司名称']) - ->addColumn('code_1', 'string', ['limit' => 50, 'default' => '', 'comment' => '快递公司代码']) - ->addColumn('code_2', 'string', ['limit' => 50, 'default' => '', 'comment' => '百度快递100代码']) - ->addColumn('code_3', 'string', ['limit' => 50, 'default' => '', 'comment' => '官方快递100代码']) - ->addColumn('remark', 'string', ['limit' => 512, 'default' => '', 'comment' => '快递公司描述']) - ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '排序权重']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '状态(0.无效,1.有效)']) - ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态(1已删除,0未删除)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('name', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '快递公司名称']) + ->addColumn('code_1', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '快递公司代码']) + ->addColumn('code_2', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '百度快递100代码']) + ->addColumn('code_3', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '官方快递100代码']) + ->addColumn('remark', 'string', ['limit' => 512, 'default' => '', 'null' => true, 'comment' => '快递公司描述']) + ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '状态(0.无效,1.有效)']) + ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(1已删除,0未删除)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('code_1', ['name' => 'idx_base_postage_company_code_1']) ->addIndex('code_2', ['name' => 'idx_base_postage_company_code_2']) ->addIndex('code_3', ['name' => 'idx_base_postage_company_code_3']) @@ -96,16 +99,16 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-快递-区域', ]) - ->addColumn('pid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '上级PID']) - ->addColumn('first', 'string', ['limit' => 50, 'default' => '', 'comment' => '首字母']) - ->addColumn('short', 'string', ['limit' => 100, 'default' => '', 'comment' => '区域简称']) - ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'comment' => '区域名称']) - ->addColumn('level', 'integer', ['limit' => 4, 'default' => 0, 'comment' => '区域层级']) - ->addColumn('pinyin', 'string', ['limit' => 100, 'default' => '', 'comment' => '区域拼音']) - ->addColumn('code', 'string', ['limit' => 100, 'default' => '', 'comment' => '区域邮编']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '使用状态']) - ->addColumn('lng', 'string', ['limit' => 100, 'default' => '', 'comment' => '所在经度']) - ->addColumn('lat', 'string', ['limit' => 100, 'default' => '', 'comment' => '所在纬度']) + ->addColumn('pid', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '上级PID']) + ->addColumn('first', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '首字母']) + ->addColumn('short', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '区域简称']) + ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '区域名称']) + ->addColumn('level', 'integer', ['limit' => 4, 'default' => 0, 'null' => true, 'comment' => '区域层级']) + ->addColumn('pinyin', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '区域拼音']) + ->addColumn('code', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '区域邮编']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '使用状态']) + ->addColumn('lng', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '所在经度']) + ->addColumn('lat', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '所在纬度']) ->addIndex('pid', ['name' => 'idx_base_postage_region_pid']) ->addIndex('name', ['name' => 'idx_base_postage_region_name']) ->save(); @@ -133,14 +136,14 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-快递-模板', ]) - ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'comment' => '模板编号']) - ->addColumn('name', 'string', ['limit' => 200, 'default' => '', 'comment' => '模板名称']) - ->addColumn('normal', 'text', ['default' => null, 'comment' => '默认规则']) - ->addColumn('content', 'text', ['default' => null, 'comment' => '模板规则']) - ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '排序权重']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '模板状态']) - ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '模板编号']) + ->addColumn('name', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '模板名称']) + ->addColumn('normal', 'text', ['default' => null, 'null' => true, 'comment' => '默认规则']) + ->addColumn('content', 'text', ['default' => null, 'null' => true, 'comment' => '模板规则']) + ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '模板状态']) + ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('code', ['name' => 'idx_base_postage_template_code']) ->addIndex('status', ['name' => 'idx_base_postage_template_status']) ->addIndex('deleted', ['name' => 'idx_base_postage_template_deleted']) @@ -169,13 +172,13 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-基础-折扣', ]) - ->addColumn('name', 'string', ['limit' => 200, 'default' => '', 'comment' => '方案名称']) - ->addColumn('items', 'text', ['default' => null, 'comment' => '方案规则']) - ->addColumn('remark', 'string', ['limit' => 500, 'default' => '', 'comment' => '方案描述']) - ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '排序权重']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '方案状态(1使用,0禁用)']) - ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('name', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '方案名称']) + ->addColumn('items', 'text', ['default' => null, 'null' => true, 'comment' => '方案规则']) + ->addColumn('remark', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '方案描述']) + ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '方案状态(1使用,0禁用)']) + ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('status', ['name' => 'idx_base_user_discount_status']) ->addIndex('deleted', ['name' => 'idx_base_user_discount_deleted']) ->save(); @@ -203,14 +206,14 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-基础-通知', ]) - ->addColumn('type', 'string', ['limit' => 50, 'default' => '', 'comment' => '消息类型']) - ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'comment' => '消息名称']) - ->addColumn('content', 'text', ['default' => null, 'comment' => '消息内容']) - ->addColumn('num_read', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '阅读次数']) - ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '排序权重']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '消息状态(1使用,0禁用)']) - ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('type', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '消息类型']) + ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '消息名称']) + ->addColumn('content', 'text', ['default' => null, 'null' => true, 'comment' => '消息内容']) + ->addColumn('num_read', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '阅读次数']) + ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '消息状态(1使用,0禁用)']) + ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('type', ['name' => 'idx_base_user_message_type']) ->addIndex('status', ['name' => 'idx_base_user_message_status']) ->addIndex('deleted', ['name' => 'idx_base_user_message_deleted']) @@ -239,16 +242,16 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-基础-支付', ]) - ->addColumn('type', 'string', ['limit' => 50, 'default' => '', 'comment' => '支付类型']) - ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'comment' => '通道编号']) - ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'comment' => '支付名称']) - ->addColumn('cover', 'string', ['limit' => 500, 'default' => '', 'comment' => '支付图标']) - ->addColumn('content', 'text', ['default' => null, 'comment' => '支付参数']) - ->addColumn('remark', 'string', ['limit' => 500, 'default' => '', 'comment' => '支付说明']) - ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '排序权重']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '支付状态(1使用,0禁用)']) - ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('type', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '支付类型']) + ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '通道编号']) + ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '支付名称']) + ->addColumn('cover', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '支付图标']) + ->addColumn('content', 'text', ['default' => null, 'null' => true, 'comment' => '支付参数']) + ->addColumn('remark', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '支付说明']) + ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '支付状态(1使用,0禁用)']) + ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('type', ['name' => 'idx_base_user_payment_type']) ->addIndex('code', ['name' => 'idx_base_user_payment_code']) ->addIndex('status', ['name' => 'idx_base_user_payment_status']) @@ -278,24 +281,24 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-用户-等级', ]) - ->addColumn('name', 'string', ['limit' => 200, 'default' => '', 'comment' => '用户级别名称']) - ->addColumn('number', 'integer', ['limit' => 2, 'default' => 0, 'comment' => '用户级别序号']) - ->addColumn('rebate_rule', 'string', ['limit' => 255, 'default' => '', 'comment' => '用户奖利规则']) - ->addColumn('upgrade_type', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '会员升级规则(0单个,1同时)']) - ->addColumn('upgrade_team', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '团队人数统计(0不计,1累计)']) - ->addColumn('goods_vip_status', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '入会礼包状态']) - ->addColumn('order_amount_status', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '订单金额状态']) - ->addColumn('order_amount_number', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '订单金额累计']) - ->addColumn('teams_users_status', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '团队人数状态']) - ->addColumn('teams_users_number', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '团队人数累计']) - ->addColumn('teams_direct_status', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '直推人数状态']) - ->addColumn('teams_direct_number', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '直推人数累计']) - ->addColumn('teams_indirect_status', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '间推人数状态']) - ->addColumn('teams_indirect_number', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '间推人数累计']) - ->addColumn('remark', 'string', ['limit' => 500, 'default' => '', 'comment' => '用户级别描述']) - ->addColumn('utime', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '等级更新时间']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '用户等级状态(1使用,0禁用)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '等级创建时间']) + ->addColumn('name', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '用户级别名称']) + ->addColumn('number', 'integer', ['limit' => 2, 'default' => 0, 'null' => true, 'comment' => '用户级别序号']) + ->addColumn('rebate_rule', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '用户奖利规则']) + ->addColumn('upgrade_type', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '会员升级规则(0单个,1同时)']) + ->addColumn('upgrade_team', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '团队人数统计(0不计,1累计)']) + ->addColumn('goods_vip_status', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '入会礼包状态']) + ->addColumn('order_amount_status', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '订单金额状态']) + ->addColumn('order_amount_number', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '订单金额累计']) + ->addColumn('teams_users_status', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '团队人数状态']) + ->addColumn('teams_users_number', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '团队人数累计']) + ->addColumn('teams_direct_status', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '直推人数状态']) + ->addColumn('teams_direct_number', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '直推人数累计']) + ->addColumn('teams_indirect_status', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '间推人数状态']) + ->addColumn('teams_indirect_number', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '间推人数累计']) + ->addColumn('remark', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '用户级别描述']) + ->addColumn('utime', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '等级更新时间']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '用户等级状态(1使用,0禁用)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '等级创建时间']) ->addIndex('status', ['name' => 'idx_base_user_upgrade_status']) ->addIndex('number', ['name' => 'idx_base_user_upgrade_number']) ->save(); @@ -323,20 +326,20 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-文章-内容', ]) - ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'comment' => '文章编号']) - ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'comment' => '文章标题']) - ->addColumn('mark', 'string', ['limit' => 200, 'default' => '', 'comment' => '文章标签']) - ->addColumn('cover', 'string', ['limit' => 500, 'default' => '', 'comment' => '文章封面']) - ->addColumn('remark', 'string', ['limit' => 500, 'default' => '', 'comment' => '备注说明']) - ->addColumn('content', 'text', ['default' => null, 'comment' => '文章内容']) - ->addColumn('num_like', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '文章点赞数']) - ->addColumn('num_read', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '文章阅读数']) - ->addColumn('num_collect', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '文章收藏数']) - ->addColumn('num_comment', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '文章评论数']) - ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '排序权重']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '文章状态(1使用,0禁用)']) - ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态(0未删,1已删)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '文章编号']) + ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '文章标题']) + ->addColumn('mark', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '文章标签']) + ->addColumn('cover', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '文章封面']) + ->addColumn('remark', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '备注说明']) + ->addColumn('content', 'text', ['default' => null, 'null' => true, 'comment' => '文章内容']) + ->addColumn('num_like', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '文章点赞数']) + ->addColumn('num_read', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '文章阅读数']) + ->addColumn('num_collect', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '文章收藏数']) + ->addColumn('num_comment', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '文章评论数']) + ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '文章状态(1使用,0禁用)']) + ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('code', ['name' => 'idx_data_news_item_code']) ->addIndex('status', ['name' => 'idx_data_news_item_status']) ->addIndex('deleted', ['name' => 'idx_data_news_item_deleted']) @@ -365,12 +368,12 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-文章-标签', ]) - ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'comment' => '标签名称']) - ->addColumn('remark', 'string', ['limit' => 500, 'default' => '', 'comment' => '标签说明']) - ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '排序权重']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '标签状态(1使用,0禁用)']) - ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '标签名称']) + ->addColumn('remark', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '标签说明']) + ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '标签状态(1使用,0禁用)']) + ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('status', ['name' => 'idx_data_news_mark_status']) ->addIndex('deleted', ['name' => 'idx_data_news_mark_deleted']) ->save(); @@ -398,12 +401,12 @@ class InstallUser extends Migrator $this->table($table, [ '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评论)']) - ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'comment' => '文章编号']) - ->addColumn('reply', 'text', ['default' => null, 'comment' => '评论内容']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '记录状态(0无效,1待审核,2已审核)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户UID']) + ->addColumn('type', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录类型(1收藏,2点赞,3历史,4评论)']) + ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '文章编号']) + ->addColumn('reply', 'text', ['default' => null, 'null' => true, 'comment' => '评论内容']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '记录状态(0无效,1待审核,2已审核)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('type', ['name' => 'idx_data_news_x_collect_type']) ->addIndex('code', ['name' => 'idx_data_news_x_collect_code']) ->addIndex('status', ['name' => 'idx_data_news_x_collect_status']) @@ -433,50 +436,50 @@ class InstallUser extends Migrator $this->table($table, [ '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']) - ->addColumn('pid2', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '推荐人二级UID']) - ->addColumn('pids', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '推荐人绑定状态']) - ->addColumn('path', 'string', ['limit' => 999, 'default' => '-', 'comment' => '推荐关系路径']) - ->addColumn('layer', 'integer', ['limit' => 20, 'default' => 1, 'comment' => '推荐关系层级']) - ->addColumn('openid1', 'string', ['limit' => 50, 'default' => '', 'comment' => '小程序OPENID']) - ->addColumn('openid2', 'string', ['limit' => 50, 'default' => '', 'comment' => '服务号OPENID']) - ->addColumn('unionid', 'string', ['limit' => 50, 'default' => '', 'comment' => '公众号UnionID']) - ->addColumn('phone', 'string', ['limit' => 20, 'default' => '', 'comment' => '用户手机']) - ->addColumn('headimg', 'string', ['limit' => 500, 'default' => '', 'comment' => '用户头像']) - ->addColumn('username', 'string', ['limit' => 50, 'default' => '', 'comment' => '用户姓名']) - ->addColumn('nickname', 'string', ['limit' => 99, 'default' => '', 'comment' => '用户昵称']) - ->addColumn('password', 'string', ['limit' => 32, 'default' => '', 'comment' => '登录密码']) - ->addColumn('region_province', 'string', ['limit' => 30, 'default' => '', 'comment' => '所在省份']) - ->addColumn('region_city', 'string', ['limit' => 30, 'default' => '', 'comment' => '所在城市']) - ->addColumn('region_area', 'string', ['limit' => 30, 'default' => '', 'comment' => '所在区域']) - ->addColumn('base_age', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '用户年龄']) - ->addColumn('base_sex', 'string', ['limit' => 10, 'default' => '', 'comment' => '用户性别']) - ->addColumn('base_height', 'string', ['limit' => 10, 'default' => '', 'comment' => '用户身高']) - ->addColumn('base_weight', 'string', ['limit' => 10, 'default' => '', 'comment' => '用户体重']) - ->addColumn('base_birthday', 'string', ['limit' => 20, 'default' => '', 'comment' => '用户生日']) - ->addColumn('vip_code', 'integer', ['limit' => 20, 'default' => 0, 'comment' => 'VIP等级编号']) - ->addColumn('vip_name', 'string', ['limit' => 30, 'default' => '普通用户', 'comment' => 'VIP等级名称']) - ->addColumn('vip_order', 'string', ['limit' => 20, 'default' => '', 'comment' => 'VIP升级订单']) - ->addColumn('vip_datetime', 'string', ['limit' => 20, 'default' => '', 'comment' => 'VIP等级时间']) - ->addColumn('buy_vip_entry', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '是否入会礼包']) - ->addColumn('buy_last_date', 'string', ['limit' => 20, 'default' => '', 'comment' => '最后支付时间']) - ->addColumn('rebate_total', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '返利金额统计']) - ->addColumn('rebate_used', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '返利提现统计']) - ->addColumn('rebate_lock', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '返利锁定统计']) - ->addColumn('balance_total', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '累计充值统计']) - ->addColumn('balance_used', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '已经使用统计']) - ->addColumn('teams_users_total', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '团队人数统计']) - ->addColumn('teams_users_direct', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '直属人数团队']) - ->addColumn('teams_users_indirect', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '间接人数团队']) - ->addColumn('order_amount_total', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '订单交易统计']) - ->addColumn('teams_amount_total', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '二级团队业绩']) - ->addColumn('teams_amount_direct', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '直属团队业绩']) - ->addColumn('teams_amount_indirect', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '间接团队业绩']) - ->addColumn('remark', 'string', ['limit' => 500, 'default' => '', 'comment' => '用户备注描述']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '用户状态(1正常,0已黑)']) - ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态(0未删,1已删)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '注册时间']) + ->addColumn('pid0', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '临时推荐人UID']) + ->addColumn('pid1', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '推荐人一级UID']) + ->addColumn('pid2', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '推荐人二级UID']) + ->addColumn('pids', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '推荐人绑定状态']) + ->addColumn('path', 'string', ['limit' => 999, 'default' => '-', 'null' => true, 'comment' => '推荐关系路径']) + ->addColumn('layer', 'integer', ['limit' => 20, 'default' => 1, 'null' => true, 'comment' => '推荐关系层级']) + ->addColumn('openid1', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '小程序OPENID']) + ->addColumn('openid2', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '服务号OPENID']) + ->addColumn('unionid', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '公众号UnionID']) + ->addColumn('phone', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '用户手机']) + ->addColumn('headimg', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '用户头像']) + ->addColumn('username', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '用户姓名']) + ->addColumn('nickname', 'string', ['limit' => 99, 'default' => '', 'null' => true, 'comment' => '用户昵称']) + ->addColumn('password', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '登录密码']) + ->addColumn('region_province', 'string', ['limit' => 30, 'default' => '', 'null' => true, 'comment' => '所在省份']) + ->addColumn('region_city', 'string', ['limit' => 30, 'default' => '', 'null' => true, 'comment' => '所在城市']) + ->addColumn('region_area', 'string', ['limit' => 30, 'default' => '', 'null' => true, 'comment' => '所在区域']) + ->addColumn('base_age', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户年龄']) + ->addColumn('base_sex', 'string', ['limit' => 10, 'default' => '', 'null' => true, 'comment' => '用户性别']) + ->addColumn('base_height', 'string', ['limit' => 10, 'default' => '', 'null' => true, 'comment' => '用户身高']) + ->addColumn('base_weight', 'string', ['limit' => 10, 'default' => '', 'null' => true, 'comment' => '用户体重']) + ->addColumn('base_birthday', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '用户生日']) + ->addColumn('vip_code', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => 'VIP等级编号']) + ->addColumn('vip_name', 'string', ['limit' => 30, 'default' => '普通用户', 'null' => true, 'comment' => 'VIP等级名称']) + ->addColumn('vip_order', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => 'VIP升级订单']) + ->addColumn('vip_datetime', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => 'VIP等级时间']) + ->addColumn('buy_vip_entry', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '是否入会礼包']) + ->addColumn('buy_last_date', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '最后支付时间']) + ->addColumn('rebate_total', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '返利金额统计']) + ->addColumn('rebate_used', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '返利提现统计']) + ->addColumn('rebate_lock', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '返利锁定统计']) + ->addColumn('balance_total', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '累计充值统计']) + ->addColumn('balance_used', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '已经使用统计']) + ->addColumn('teams_users_total', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '团队人数统计']) + ->addColumn('teams_users_direct', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '直属人数团队']) + ->addColumn('teams_users_indirect', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '间接人数团队']) + ->addColumn('order_amount_total', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '订单交易统计']) + ->addColumn('teams_amount_total', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '二级团队业绩']) + ->addColumn('teams_amount_direct', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '直属团队业绩']) + ->addColumn('teams_amount_indirect', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '间接团队业绩']) + ->addColumn('remark', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '用户备注描述']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '用户状态(1正常,0已黑)']) + ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '注册时间']) ->addIndex('status', ['name' => 'idx_data_user_status']) ->addIndex('deleted', ['name' => 'idx_data_user_deleted']) ->addIndex('openid1', ['name' => 'idx_data_user_openid1']) @@ -511,20 +514,20 @@ class InstallUser extends Migrator $this->table($table, [ '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默认)']) - ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'comment' => '地址编号']) - ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'comment' => '收货姓名']) - ->addColumn('phone', 'string', ['limit' => 20, 'default' => '', 'comment' => '收货手机']) - ->addColumn('idcode', 'string', ['limit' => 255, 'default' => '', 'comment' => '身体证号']) - ->addColumn('idimg1', 'string', ['limit' => 500, 'default' => '', 'comment' => '身份证正面']) - ->addColumn('idimg2', 'string', ['limit' => 500, 'default' => '', 'comment' => '身份证反面']) - ->addColumn('province', 'string', ['limit' => 100, 'default' => '', 'comment' => '地址-省份']) - ->addColumn('city', 'string', ['limit' => 100, 'default' => '', 'comment' => '地址-城市']) - ->addColumn('area', 'string', ['limit' => 100, 'default' => '', 'comment' => '地址-区域']) - ->addColumn('address', 'string', ['limit' => 255, 'default' => '', 'comment' => '地址-详情']) - ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户UID']) + ->addColumn('type', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '地址类型(0普通,1默认)']) + ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '地址编号']) + ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '收货姓名']) + ->addColumn('phone', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '收货手机']) + ->addColumn('idcode', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '身体证号']) + ->addColumn('idimg1', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '身份证正面']) + ->addColumn('idimg2', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '身份证反面']) + ->addColumn('province', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '地址-省份']) + ->addColumn('city', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '地址-城市']) + ->addColumn('area', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '地址-区域']) + ->addColumn('address', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '地址-详情']) + ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('type', ['name' => 'idx_data_user_address_type']) ->addIndex('code', ['name' => 'idx_data_user_address_code']) ->addIndex('deleted', ['name' => 'idx_data_user_address_deleted']) @@ -554,15 +557,15 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-用户-余额', ]) - ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '用户UID']) - ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'comment' => '充值编号']) - ->addColumn('name', 'string', ['limit' => 200, 'default' => '', 'comment' => '充值名称']) - ->addColumn('remark', 'string', ['limit' => 999, 'default' => '', 'comment' => '充值备注']) - ->addColumn('amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '充值金额']) - ->addColumn('upgrade', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '强制升级']) - ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态']) - ->addColumn('create_by', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '系统用户']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户UID']) + ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '充值编号']) + ->addColumn('name', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '充值名称']) + ->addColumn('remark', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '充值备注']) + ->addColumn('amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '充值金额']) + ->addColumn('upgrade', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '强制升级']) + ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态']) + ->addColumn('create_by', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '系统用户']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('code', ['name' => 'idx_data_user_balance_code']) ->addIndex('deleted', ['name' => 'idx_data_user_balance_deleted']) ->addIndex('uuid', ['name' => 'idx_data_user_balance_uuid']) @@ -591,13 +594,13 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-用户-会员', ]) - ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '登录用户']) - ->addColumn('phone', 'string', ['limit' => 20, 'default' => '', 'comment' => '用户手机']) - ->addColumn('regon_ip', 'string', ['limit' => 50, 'default' => '', 'comment' => '登录地址']) - ->addColumn('region_prov', 'string', ['limit' => 50, 'default' => '', 'comment' => '所有省份']) - ->addColumn('region_city', 'string', ['limit' => 50, 'default' => '', 'comment' => '所在城市']) - ->addColumn('region_area', 'string', ['limit' => 50, 'default' => '', 'comment' => '所在区间']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '注册时间']) + ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '登录用户']) + ->addColumn('phone', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '用户手机']) + ->addColumn('regon_ip', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '登录地址']) + ->addColumn('region_prov', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '所有省份']) + ->addColumn('region_city', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '所在城市']) + ->addColumn('region_area', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '所在区间']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '注册时间']) ->addIndex('uuid', ['name' => 'idx_data_user_logger_uuid']) ->save(); @@ -624,14 +627,14 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-用户-短信', ]) - ->addColumn('type', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '短信类型']) - ->addColumn('msgid', 'string', ['limit' => 50, 'default' => '', 'comment' => '消息编号']) - ->addColumn('phone', 'string', ['limit' => 100, 'default' => '', 'comment' => '目标手机']) - ->addColumn('region', 'string', ['limit' => 100, 'default' => '', 'comment' => '国家编号']) - ->addColumn('result', 'string', ['limit' => 100, 'default' => '', 'comment' => '返回结果']) - ->addColumn('content', 'string', ['limit' => 512, 'default' => '', 'comment' => '短信内容']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '短信状态(0失败,1成功)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('type', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '短信类型']) + ->addColumn('msgid', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '消息编号']) + ->addColumn('phone', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '目标手机']) + ->addColumn('region', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '国家编号']) + ->addColumn('result', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '返回结果']) + ->addColumn('content', 'string', ['limit' => 512, 'default' => '', 'null' => true, 'comment' => '短信内容']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '短信状态(0失败,1成功)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('type', ['name' => 'idx_data_user_message_type']) ->addIndex('status', ['name' => 'idx_data_user_message_status']) ->addIndex('phone', ['name' => 'idx_data_user_message_phone']) @@ -661,16 +664,16 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-用户-支付', ]) - ->addColumn('order_no', 'string', ['limit' => 20, 'default' => '', 'comment' => '订单单号']) - ->addColumn('order_name', 'string', ['limit' => 255, 'default' => '', 'comment' => '订单描述']) - ->addColumn('order_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '订单金额']) - ->addColumn('payment_code', 'string', ['limit' => 20, 'default' => '', 'comment' => '支付编号']) - ->addColumn('payment_type', 'string', ['limit' => 50, 'default' => '', 'comment' => '支付通道']) - ->addColumn('payment_trade', 'string', ['limit' => 100, 'default' => '', 'comment' => '支付单号']) - ->addColumn('payment_status', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '支付状态']) - ->addColumn('payment_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '支付金额']) - ->addColumn('payment_datetime', 'string', ['limit' => 20, 'default' => '', 'comment' => '支付时间']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('order_no', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '订单单号']) + ->addColumn('order_name', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '订单描述']) + ->addColumn('order_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '订单金额']) + ->addColumn('payment_code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '支付编号']) + ->addColumn('payment_type', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '支付通道']) + ->addColumn('payment_trade', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '支付单号']) + ->addColumn('payment_status', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '支付状态']) + ->addColumn('payment_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '支付金额']) + ->addColumn('payment_datetime', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '支付时间']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('order_no', ['name' => 'idx_data_user_payment_order_no']) ->addIndex('payment_code', ['name' => 'idx_data_user_payment_payment_code']) ->addIndex('payment_type', ['name' => 'idx_data_user_payment_payment_type']) @@ -701,18 +704,18 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-用户-返利', ]) - ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '用户UID']) - ->addColumn('date', 'string', ['limit' => 20, 'default' => '', 'comment' => '奖励日期']) - ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'comment' => '奖励编号']) - ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'comment' => '奖励类型']) - ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'comment' => '奖励名称']) - ->addColumn('amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '奖励数量']) - ->addColumn('order_no', 'string', ['limit' => 20, 'default' => '', 'comment' => '订单单号']) - ->addColumn('order_uuid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '订单用户']) - ->addColumn('order_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '订单金额']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '生效状态(0未生效,1已生效)']) - ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态(0未删除,1已删除)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户UID']) + ->addColumn('date', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '奖励日期']) + ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '奖励编号']) + ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '奖励类型']) + ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '奖励名称']) + ->addColumn('amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '奖励数量']) + ->addColumn('order_no', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '订单单号']) + ->addColumn('order_uuid', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '订单用户']) + ->addColumn('order_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '订单金额']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '生效状态(0未生效,1已生效)']) + ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删除,1已删除)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('type', ['name' => 'idx_data_user_rebate_type']) ->addIndex('date', ['name' => 'idx_data_user_rebate_date']) ->addIndex('code', ['name' => 'idx_data_user_rebate_code']) @@ -744,12 +747,12 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-用户-认证', ]) - ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '用户UID']) - ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'comment' => '授权类型']) - ->addColumn('time', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '有效时间']) - ->addColumn('token', 'string', ['limit' => 32, 'default' => '', 'comment' => '授权令牌']) - ->addColumn('tokenv', 'string', ['limit' => 32, 'default' => '', 'comment' => '授权验证']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户UID']) + ->addColumn('type', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '授权类型']) + ->addColumn('time', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '有效时间']) + ->addColumn('token', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '授权令牌']) + ->addColumn('tokenv', 'string', ['limit' => 32, 'default' => '', 'null' => true, 'comment' => '授权验证']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('uuid', ['name' => 'idx_data_user_token_uuid']) ->addIndex('type', ['name' => 'idx_data_user_token_type']) ->addIndex('time', ['name' => 'idx_data_user_token_time']) @@ -779,33 +782,33 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '数据-用户-提现', ]) - ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '用户UID']) - ->addColumn('type', 'string', ['limit' => 30, 'default' => '', 'comment' => '提现方式']) - ->addColumn('date', 'string', ['limit' => 20, 'default' => '', 'comment' => '提现日期']) - ->addColumn('code', 'string', ['limit' => 100, 'default' => '', 'comment' => '提现单号']) - ->addColumn('appid', 'string', ['limit' => 100, 'default' => '', 'comment' => '公众号APPID']) - ->addColumn('openid', 'string', ['limit' => 100, 'default' => '', 'comment' => '公众号OPENID']) - ->addColumn('charge_rate', 'decimal', ['precision' => 20, 'scale' => 4, 'default' => '0.0000', 'comment' => '提现手续费比例']) - ->addColumn('charge_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '提现手续费金额']) - ->addColumn('amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '提现转账金额']) - ->addColumn('qrcode', 'string', ['limit' => 999, 'default' => '', 'comment' => '收款码图片地址']) - ->addColumn('bank_wseq', 'string', ['limit' => 20, 'default' => '', 'comment' => '微信银行编号']) - ->addColumn('bank_name', 'string', ['limit' => 100, 'default' => '', 'comment' => '开户银行名称']) - ->addColumn('bank_bran', 'string', ['limit' => 100, 'default' => '', 'comment' => '开户分行名称']) - ->addColumn('bank_user', 'string', ['limit' => 100, 'default' => '', 'comment' => '开户账号姓名']) - ->addColumn('bank_code', 'string', ['limit' => 100, 'default' => '', 'comment' => '开户银行卡号']) - ->addColumn('alipay_user', 'string', ['limit' => 100, 'default' => '', 'comment' => '支付宝姓名']) - ->addColumn('alipay_code', 'string', ['limit' => 100, 'default' => '', 'comment' => '支付宝账号']) - ->addColumn('remark', 'string', ['limit' => 200, 'default' => '', 'comment' => '提现描述']) - ->addColumn('trade_no', 'string', ['limit' => 100, 'default' => '', 'comment' => '交易单号']) - ->addColumn('trade_time', 'string', ['limit' => 20, 'default' => '', 'comment' => '打款时间']) - ->addColumn('change_time', 'string', ['limit' => 20, 'default' => '', 'comment' => '处理时间']) - ->addColumn('change_desc', 'string', ['limit' => 500, 'default' => '', 'comment' => '处理描述']) - ->addColumn('audit_status', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '审核状态']) - ->addColumn('audit_remark', 'string', ['limit' => 500, 'default' => '', 'comment' => '审核描述']) - ->addColumn('audit_datetime', 'string', ['limit' => 20, 'default' => '', 'comment' => '审核时间']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '提现状态(0失败,1待审核,2已审核,3打款中,4已打款,5已收款)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户UID']) + ->addColumn('type', 'string', ['limit' => 30, 'default' => '', 'null' => true, 'comment' => '提现方式']) + ->addColumn('date', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '提现日期']) + ->addColumn('code', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '提现单号']) + ->addColumn('appid', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '公众号APPID']) + ->addColumn('openid', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '公众号OPENID']) + ->addColumn('charge_rate', 'decimal', ['precision' => 20, 'scale' => 4, 'default' => '0.0000', 'null' => true, 'comment' => '提现手续费比例']) + ->addColumn('charge_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '提现手续费金额']) + ->addColumn('amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '提现转账金额']) + ->addColumn('qrcode', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '收款码图片地址']) + ->addColumn('bank_wseq', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '微信银行编号']) + ->addColumn('bank_name', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '开户银行名称']) + ->addColumn('bank_bran', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '开户分行名称']) + ->addColumn('bank_user', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '开户账号姓名']) + ->addColumn('bank_code', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '开户银行卡号']) + ->addColumn('alipay_user', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '支付宝姓名']) + ->addColumn('alipay_code', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '支付宝账号']) + ->addColumn('remark', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '提现描述']) + ->addColumn('trade_no', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '交易单号']) + ->addColumn('trade_time', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '打款时间']) + ->addColumn('change_time', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '处理时间']) + ->addColumn('change_desc', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '处理描述']) + ->addColumn('audit_status', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '审核状态']) + ->addColumn('audit_remark', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '审核描述']) + ->addColumn('audit_datetime', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '审核时间']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '提现状态(0失败,1待审核,2已审核,3打款中,4已打款,5已收款)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('code', ['name' => 'idx_data_user_transfer_code']) ->addIndex('status', ['name' => 'idx_data_user_transfer_status']) ->addIndex('date', ['name' => 'idx_data_user_transfer_date']) @@ -839,37 +842,37 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-商品-内容', ]) - ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'comment' => '商品编号']) - ->addColumn('name', 'string', ['limit' => 500, 'default' => '', 'comment' => '商品名称']) - ->addColumn('marks', 'string', ['limit' => 999, 'default' => '', 'comment' => '商品标签']) - ->addColumn('cateids', 'string', ['limit' => 999, 'default' => '', 'comment' => '分类编号']) - ->addColumn('cover', 'string', ['limit' => 999, 'default' => '', 'comment' => '商品封面']) - ->addColumn('slider', 'text', ['default' => null, 'comment' => '轮播图片']) - ->addColumn('remark', 'string', ['limit' => 999, 'default' => '', 'comment' => '商品描述']) - ->addColumn('content', 'text', ['default' => null, 'comment' => '商品详情']) - ->addColumn('payment', 'string', ['limit' => 999, 'default' => '', 'comment' => '支付方式']) - ->addColumn('data_specs', 'text', ['default' => null, 'comment' => '商品规格(JSON)']) - ->addColumn('data_items', 'text', ['default' => null, 'comment' => '商品规格(JSON)']) - ->addColumn('stock_total', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '商品库存统计']) - ->addColumn('stock_sales', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '商品销售统计']) - ->addColumn('stock_virtual', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '商品虚拟销量']) - ->addColumn('price_selling', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '最低销售价格']) - ->addColumn('price_market', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '最低市场价格']) - ->addColumn('discount_id', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '折扣方案编号']) - ->addColumn('truck_code', 'string', ['limit' => 20, 'default' => '', 'comment' => '物流运费模板']) - ->addColumn('truck_type', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '物流配送(0无需配送,1需要配送)']) - ->addColumn('rebate_type', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '参与返利(0无需返利,1需要返利)']) - ->addColumn('vip_entry', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '入会礼包(0非入会礼包,1是入会礼包)']) - ->addColumn('vip_upgrade', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '购买升级等级(0不升级,其他升级)']) - ->addColumn('limit_low_vip', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '限制最低等级(0不限制,其他限制)']) - ->addColumn('limit_max_num', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '最大购买数量(0不限制,其他限制)']) - ->addColumn('num_read', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '访问阅读统计']) - ->addColumn('state_hot', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '设置热度标签']) - ->addColumn('state_home', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '设置首页推荐']) - ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '列表排序权重']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '商品状态(1使用,0禁用)']) - ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态(0未删,1已删)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商品编号']) + ->addColumn('name', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '商品名称']) + ->addColumn('marks', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '商品标签']) + ->addColumn('cateids', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '分类编号']) + ->addColumn('cover', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '商品封面']) + ->addColumn('slider', 'text', ['default' => null, 'null' => true, 'comment' => '轮播图片']) + ->addColumn('remark', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '商品描述']) + ->addColumn('content', 'text', ['default' => null, 'null' => true, 'comment' => '商品详情']) + ->addColumn('payment', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '支付方式']) + ->addColumn('data_specs', 'text', ['default' => null, 'null' => true, 'comment' => '商品规格(JSON)']) + ->addColumn('data_items', 'text', ['default' => null, 'null' => true, 'comment' => '商品规格(JSON)']) + ->addColumn('stock_total', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '商品库存统计']) + ->addColumn('stock_sales', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '商品销售统计']) + ->addColumn('stock_virtual', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '商品虚拟销量']) + ->addColumn('price_selling', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '最低销售价格']) + ->addColumn('price_market', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '最低市场价格']) + ->addColumn('discount_id', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '折扣方案编号']) + ->addColumn('truck_code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '物流运费模板']) + ->addColumn('truck_type', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '物流配送(0无需配送,1需要配送)']) + ->addColumn('rebate_type', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '参与返利(0无需返利,1需要返利)']) + ->addColumn('vip_entry', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '入会礼包(0非入会礼包,1是入会礼包)']) + ->addColumn('vip_upgrade', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '购买升级等级(0不升级,其他升级)']) + ->addColumn('limit_low_vip', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '限制最低等级(0不限制,其他限制)']) + ->addColumn('limit_max_num', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '最大购买数量(0不限制,其他限制)']) + ->addColumn('num_read', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '访问阅读统计']) + ->addColumn('state_hot', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '设置热度标签']) + ->addColumn('state_home', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '设置首页推荐']) + ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '列表排序权重']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '商品状态(1使用,0禁用)']) + ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('code', ['name' => 'idx_shop_goods_code']) ->addIndex('status', ['name' => 'idx_shop_goods_status']) ->addIndex('deleted', ['name' => 'idx_shop_goods_deleted']) @@ -898,14 +901,14 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-商品-分类', ]) - ->addColumn('pid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '上级分类']) - ->addColumn('name', 'string', ['limit' => 255, 'default' => '', 'comment' => '分类名称']) - ->addColumn('cover', 'string', ['limit' => 500, 'default' => '', 'comment' => '分类图标']) - ->addColumn('remark', 'string', ['limit' => 999, 'default' => '', 'comment' => '分类描述']) - ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '排序权重']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '使用状态']) - ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('pid', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '上级分类']) + ->addColumn('name', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '分类名称']) + ->addColumn('cover', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '分类图标']) + ->addColumn('remark', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '分类描述']) + ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '使用状态']) + ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('sort', ['name' => 'idx_shop_goods_cate_sort']) ->addIndex('status', ['name' => 'idx_shop_goods_cate_status']) ->addIndex('deleted', ['name' => 'idx_shop_goods_cate_deleted']) @@ -934,19 +937,19 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-商品-规格', ]) - ->addColumn('goods_sku', 'string', ['limit' => 20, 'default' => '', 'comment' => '商品SKU']) - ->addColumn('goods_code', 'string', ['limit' => 20, 'default' => '', 'comment' => '商品编号']) - ->addColumn('goods_spec', 'string', ['limit' => 100, 'default' => '', 'comment' => '商品规格']) - ->addColumn('stock_sales', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '销售数量']) - ->addColumn('stock_total', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '商品库存']) - ->addColumn('price_selling', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '销售价格']) - ->addColumn('price_market', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '市场价格']) - ->addColumn('number_virtual', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '虚拟销量']) - ->addColumn('number_express', 'integer', ['limit' => 20, 'default' => 1, 'comment' => '配送计件']) - ->addColumn('reward_balance', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '奖励余额']) - ->addColumn('reward_integral', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '奖励积分']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '商品状态']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('goods_sku', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商品SKU']) + ->addColumn('goods_code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商品编号']) + ->addColumn('goods_spec', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '商品规格']) + ->addColumn('stock_sales', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '销售数量']) + ->addColumn('stock_total', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '商品库存']) + ->addColumn('price_selling', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '销售价格']) + ->addColumn('price_market', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '市场价格']) + ->addColumn('number_virtual', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '虚拟销量']) + ->addColumn('number_express', 'integer', ['limit' => 20, 'default' => 1, 'null' => true, 'comment' => '配送计件']) + ->addColumn('reward_balance', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '奖励余额']) + ->addColumn('reward_integral', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '奖励积分']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '商品状态']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('goods_code', ['name' => 'idx_shop_goods_item_goods_code']) ->addIndex('goods_spec', ['name' => 'idx_shop_goods_item_goods_spec']) ->addIndex('status', ['name' => 'idx_shop_goods_item_status']) @@ -975,11 +978,11 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-商品-标签', ]) - ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'comment' => '标签名称']) - ->addColumn('remark', 'string', ['limit' => 200, 'default' => '', 'comment' => '标签描述']) - ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '排序权重']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '标签状态(1使用,0禁用)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('name', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '标签名称']) + ->addColumn('remark', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '标签描述']) + ->addColumn('sort', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '排序权重']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '标签状态(1使用,0禁用)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('sort', ['name' => 'idx_shop_goods_mark_sort']) ->addIndex('status', ['name' => 'idx_shop_goods_mark_status']) ->save(); @@ -1007,13 +1010,13 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-商品-库存', ]) - ->addColumn('batch_no', 'string', ['limit' => 20, 'default' => '', 'comment' => '操作批量']) - ->addColumn('goods_code', 'string', ['limit' => 20, 'default' => '', 'comment' => '商品编号']) - ->addColumn('goods_spec', 'string', ['limit' => 100, 'default' => '', 'comment' => '商品规格']) - ->addColumn('goods_stock', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '入库数量']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '数据状态(1使用,0禁用)']) - ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态(0未删,1已删)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) + ->addColumn('batch_no', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '操作批量']) + ->addColumn('goods_code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商品编号']) + ->addColumn('goods_spec', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '商品规格']) + ->addColumn('goods_stock', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '入库数量']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '数据状态(1使用,0禁用)']) + ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('status', ['name' => 'idx_shop_goods_stock_status']) ->addIndex('deleted', ['name' => 'idx_shop_goods_stock_deleted']) ->save(); @@ -1041,40 +1044,40 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-订单-内容', ]) - ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '下单用户编号']) - ->addColumn('puid1', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '推荐一层用户']) - ->addColumn('puid2', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '推荐二层用户']) - ->addColumn('order_no', 'string', ['limit' => 20, 'default' => '', 'comment' => '商品订单单号']) - ->addColumn('amount_real', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '订单实际金额']) - ->addColumn('amount_total', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '订单统计金额']) - ->addColumn('amount_goods', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '商品统计金额']) - ->addColumn('amount_reduct', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '随机减免金额']) - ->addColumn('amount_express', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '快递费用金额']) - ->addColumn('amount_discount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '折扣后的金额']) - ->addColumn('payment_type', 'string', ['limit' => 20, 'default' => '', 'comment' => '实际支付平台']) - ->addColumn('payment_code', 'string', ['limit' => 20, 'default' => '', 'comment' => '实际通道编号']) - ->addColumn('payment_allow', 'string', ['limit' => 999, 'default' => '', 'comment' => '允许支付通道']) - ->addColumn('payment_trade', 'string', ['limit' => 80, 'default' => '', 'comment' => '实际支付单号']) - ->addColumn('payment_status', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '实际支付状态']) - ->addColumn('payment_image', 'string', ['limit' => 999, 'default' => '', 'comment' => '支付凭证图片']) - ->addColumn('payment_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '实际支付金额']) - ->addColumn('payment_balance', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '余额抵扣金额']) - ->addColumn('payment_remark', 'string', ['limit' => 500, 'default' => '', 'comment' => '支付结果描述']) - ->addColumn('payment_datetime', 'string', ['limit' => 20, 'default' => '', 'comment' => '支付到账时间']) - ->addColumn('number_goods', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '订单商品数量']) - ->addColumn('number_express', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '订单快递计数']) - ->addColumn('truck_type', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '物流配送类型(0无需配送,1需要配送)']) - ->addColumn('rebate_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '参与返利金额']) - ->addColumn('reward_balance', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '奖励账户余额']) - ->addColumn('order_remark', 'string', ['limit' => 999, 'default' => '', 'comment' => '订单用户备注']) - ->addColumn('cancel_status', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '订单取消状态']) - ->addColumn('cancel_remark', 'string', ['limit' => 200, 'default' => '', 'comment' => '订单取消描述']) - ->addColumn('cancel_datetime', 'string', ['limit' => 20, 'default' => '', 'comment' => '订单取消时间']) - ->addColumn('deleted_status', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '订单删除状态(0未删,1已删)']) - ->addColumn('deleted_remark', 'string', ['limit' => 255, 'default' => '', 'comment' => '订单删除描述']) - ->addColumn('deleted_datetime', 'string', ['limit' => 20, 'default' => '', 'comment' => '订单删除时间']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '订单流程状态(0已取消,1预订单,2待支付,3支付中,4已支付,5已发货,6已完成)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '订单创建时间']) + ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '下单用户编号']) + ->addColumn('puid1', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '推荐一层用户']) + ->addColumn('puid2', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '推荐二层用户']) + ->addColumn('order_no', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商品订单单号']) + ->addColumn('amount_real', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '订单实际金额']) + ->addColumn('amount_total', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '订单统计金额']) + ->addColumn('amount_goods', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品统计金额']) + ->addColumn('amount_reduct', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '随机减免金额']) + ->addColumn('amount_express', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '快递费用金额']) + ->addColumn('amount_discount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '折扣后的金额']) + ->addColumn('payment_type', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '实际支付平台']) + ->addColumn('payment_code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '实际通道编号']) + ->addColumn('payment_allow', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '允许支付通道']) + ->addColumn('payment_trade', 'string', ['limit' => 80, 'default' => '', 'null' => true, 'comment' => '实际支付单号']) + ->addColumn('payment_status', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '实际支付状态']) + ->addColumn('payment_image', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '支付凭证图片']) + ->addColumn('payment_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '实际支付金额']) + ->addColumn('payment_balance', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '余额抵扣金额']) + ->addColumn('payment_remark', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '支付结果描述']) + ->addColumn('payment_datetime', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '支付到账时间']) + ->addColumn('number_goods', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '订单商品数量']) + ->addColumn('number_express', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '订单快递计数']) + ->addColumn('truck_type', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '物流配送类型(0无需配送,1需要配送)']) + ->addColumn('rebate_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '参与返利金额']) + ->addColumn('reward_balance', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '奖励账户余额']) + ->addColumn('order_remark', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '订单用户备注']) + ->addColumn('cancel_status', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '订单取消状态']) + ->addColumn('cancel_remark', 'string', ['limit' => 200, 'default' => '', 'null' => true, 'comment' => '订单取消描述']) + ->addColumn('cancel_datetime', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '订单取消时间']) + ->addColumn('deleted_status', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '订单删除状态(0未删,1已删)']) + ->addColumn('deleted_remark', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '订单删除描述']) + ->addColumn('deleted_datetime', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '订单删除时间']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '订单流程状态(0已取消,1预订单,2待支付,3支付中,4已支付,5已发货,6已完成)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '订单创建时间']) ->addIndex('status', ['name' => 'idx_shop_order_status']) ->addIndex('order_no', ['name' => 'idx_shop_order_order_no']) ->addIndex('cancel_status', ['name' => 'idx_shop_order_cancel_status']) @@ -1107,36 +1110,36 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-订单-商品', ]) - ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '商城用户编号']) - ->addColumn('order_no', 'string', ['limit' => 20, 'default' => '', 'comment' => '商城订单单号']) - ->addColumn('goods_sku', 'string', ['limit' => 20, 'default' => '', 'comment' => '商城商品SKU']) - ->addColumn('goods_code', 'string', ['limit' => 20, 'default' => '', 'comment' => '商城商品编号']) - ->addColumn('goods_spec', 'string', ['limit' => 100, 'default' => '', 'comment' => '商城商品规格']) - ->addColumn('goods_name', 'string', ['limit' => 250, 'default' => '', 'comment' => '商城商品名称']) - ->addColumn('goods_cover', 'string', ['limit' => 500, 'default' => '', 'comment' => '商品封面图片']) - ->addColumn('goods_payment', 'string', ['limit' => 999, 'default' => '', 'comment' => '指定支付通道']) - ->addColumn('price_market', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '商品市场单价']) - ->addColumn('price_selling', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '商品销售单价']) - ->addColumn('total_market', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '商品市场总价']) - ->addColumn('total_selling', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '商品销售总价']) - ->addColumn('reward_balance', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '商品奖励余额']) - ->addColumn('reward_integral', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '商品奖励积分']) - ->addColumn('stock_sales', 'integer', ['limit' => 20, 'default' => 1, 'comment' => '包含商品数量']) - ->addColumn('vip_name', 'string', ['limit' => 30, 'default' => '', 'comment' => '用户等级名称']) - ->addColumn('vip_code', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '用户等级序号']) - ->addColumn('vip_entry', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '是否入会礼包(0非礼包,1是礼包)']) - ->addColumn('vip_upgrade', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '升级用户等级']) - ->addColumn('truck_type', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '物流配送类型(0虚物,1实物)']) - ->addColumn('truck_code', 'string', ['limit' => 20, 'default' => '', 'comment' => '快递邮费模板']) - ->addColumn('truck_number', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '快递计费基数']) - ->addColumn('rebate_type', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '参与返利状态(0不返,1返利)']) - ->addColumn('rebate_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '参与返利金额']) - ->addColumn('discount_id', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '优惠方案编号']) - ->addColumn('discount_rate', 'decimal', ['precision' => 20, 'scale' => 6, 'default' => '100.000000', 'comment' => '销售价格折扣']) - ->addColumn('discount_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '商品优惠金额']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '商品状态(1使用,0禁用)']) - ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '删除状态(0未删,1已删)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '订单创建时间']) + ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '商城用户编号']) + ->addColumn('order_no', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商城订单单号']) + ->addColumn('goods_sku', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商城商品SKU']) + ->addColumn('goods_code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商城商品编号']) + ->addColumn('goods_spec', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '商城商品规格']) + ->addColumn('goods_name', 'string', ['limit' => 250, 'default' => '', 'null' => true, 'comment' => '商城商品名称']) + ->addColumn('goods_cover', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '商品封面图片']) + ->addColumn('goods_payment', 'string', ['limit' => 999, 'default' => '', 'null' => true, 'comment' => '指定支付通道']) + ->addColumn('price_market', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品市场单价']) + ->addColumn('price_selling', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品销售单价']) + ->addColumn('total_market', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品市场总价']) + ->addColumn('total_selling', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品销售总价']) + ->addColumn('reward_balance', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品奖励余额']) + ->addColumn('reward_integral', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品奖励积分']) + ->addColumn('stock_sales', 'integer', ['limit' => 20, 'default' => 1, 'null' => true, 'comment' => '包含商品数量']) + ->addColumn('vip_name', 'string', ['limit' => 30, 'default' => '', 'null' => true, 'comment' => '用户等级名称']) + ->addColumn('vip_code', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '用户等级序号']) + ->addColumn('vip_entry', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '是否入会礼包(0非礼包,1是礼包)']) + ->addColumn('vip_upgrade', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '升级用户等级']) + ->addColumn('truck_type', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '物流配送类型(0虚物,1实物)']) + ->addColumn('truck_code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '快递邮费模板']) + ->addColumn('truck_number', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '快递计费基数']) + ->addColumn('rebate_type', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '参与返利状态(0不返,1返利)']) + ->addColumn('rebate_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '参与返利金额']) + ->addColumn('discount_id', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '优惠方案编号']) + ->addColumn('discount_rate', 'decimal', ['precision' => 20, 'scale' => 6, 'default' => '100.000000', 'null' => true, 'comment' => '销售价格折扣']) + ->addColumn('discount_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '商品优惠金额']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '商品状态(1使用,0禁用)']) + ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '删除状态(0未删,1已删)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '订单创建时间']) ->addIndex('status', ['name' => 'idx_shop_order_item_status']) ->addIndex('deleted', ['name' => 'idx_shop_order_item_deleted']) ->addIndex('order_no', ['name' => 'idx_shop_order_item_order_no']) @@ -1169,38 +1172,39 @@ class InstallUser extends Migrator $this->table($table, [ 'engine' => 'InnoDB', 'collation' => 'utf8mb4_general_ci', 'comment' => '商城-订单-配送', ]) - ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '商城用户编号']) - ->addColumn('order_no', 'string', ['limit' => 20, 'default' => '', 'comment' => '商城订单单号']) - ->addColumn('address_code', 'string', ['limit' => 20, 'default' => '', 'comment' => '配送地址编号']) - ->addColumn('address_name', 'string', ['limit' => 50, 'default' => '', 'comment' => '配送收货人姓名']) - ->addColumn('address_phone', 'string', ['limit' => 20, 'default' => '', 'comment' => '配送收货人手机']) - ->addColumn('address_idcode', 'string', ['limit' => 100, 'default' => '', 'comment' => '配送收货人证件号码']) - ->addColumn('address_idimg1', 'string', ['limit' => 500, 'default' => '', 'comment' => '配送收货人证件正面']) - ->addColumn('address_idimg2', 'string', ['limit' => 500, 'default' => '', 'comment' => '配送收货人证件反面']) - ->addColumn('address_province', 'string', ['limit' => 30, 'default' => '', 'comment' => '配送地址的省份']) - ->addColumn('address_city', 'string', ['limit' => 30, 'default' => '', 'comment' => '配送地址的城市']) - ->addColumn('address_area', 'string', ['limit' => 30, 'default' => '', 'comment' => '配送地址的区域']) - ->addColumn('address_content', 'string', ['limit' => 255, 'default' => '', 'comment' => '配送的详细地址']) - ->addColumn('address_datetime', 'string', ['limit' => 20, 'default' => '', 'comment' => '地址确认时间']) - ->addColumn('template_code', 'string', ['limit' => 20, 'default' => '', 'comment' => '配送模板编号']) - ->addColumn('template_count', 'integer', ['limit' => 20, 'default' => 0, 'comment' => '快递计费基数']) - ->addColumn('template_remark', 'string', ['limit' => 255, 'default' => '', 'comment' => '配送计算描述']) - ->addColumn('template_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'comment' => '配送计算金额']) - ->addColumn('company_code', 'string', ['limit' => 20, 'default' => '', 'comment' => '快递公司编码']) - ->addColumn('company_name', 'string', ['limit' => 100, 'default' => '', 'comment' => '快递公司名称']) - ->addColumn('send_number', 'string', ['limit' => 100, 'default' => '', 'comment' => '快递运送单号']) - ->addColumn('send_remark', 'string', ['limit' => 255, 'default' => '', 'comment' => '快递发送备注']) - ->addColumn('send_datetime', 'string', ['limit' => 20, 'default' => '', 'comment' => '快递发送时间']) - ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'comment' => '发货商品状态(1使用,0禁用)']) - ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'comment' => '发货删除状态(0未删,1已删)']) - ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'comment' => '创建时间']) - ->addIndex('uuid', ['name' => 'idx_shop_order_send_uuid']) + ->addColumn('uuid', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '商城用户编号']) + ->addColumn('order_no', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '商城订单单号']) + ->addColumn('address_code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '配送地址编号']) + ->addColumn('address_name', 'string', ['limit' => 50, 'default' => '', 'null' => true, 'comment' => '配送收货人姓名']) + ->addColumn('address_phone', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '配送收货人手机']) + ->addColumn('address_idcode', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '配送收货人证件号码']) + ->addColumn('address_idimg1', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '配送收货人证件正面']) + ->addColumn('address_idimg2', 'string', ['limit' => 500, 'default' => '', 'null' => true, 'comment' => '配送收货人证件反面']) + ->addColumn('address_province', 'string', ['limit' => 30, 'default' => '', 'null' => true, 'comment' => '配送地址的省份']) + ->addColumn('address_city', 'string', ['limit' => 30, 'default' => '', 'null' => true, 'comment' => '配送地址的城市']) + ->addColumn('address_area', 'string', ['limit' => 30, 'default' => '', 'null' => true, 'comment' => '配送地址的区域']) + ->addColumn('address_content', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '配送的详细地址']) + ->addColumn('address_datetime', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '地址确认时间']) + ->addColumn('template_code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '配送模板编号']) + ->addColumn('template_count', 'integer', ['limit' => 20, 'default' => 0, 'null' => true, 'comment' => '快递计费基数']) + ->addColumn('template_remark', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '配送计算描述']) + ->addColumn('template_amount', 'decimal', ['precision' => 20, 'scale' => 2, 'default' => '0.00', 'null' => true, 'comment' => '配送计算金额']) + ->addColumn('company_code', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '快递公司编码']) + ->addColumn('company_name', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '快递公司名称']) + ->addColumn('send_number', 'string', ['limit' => 100, 'default' => '', 'null' => true, 'comment' => '快递运送单号']) + ->addColumn('send_remark', 'string', ['limit' => 255, 'default' => '', 'null' => true, 'comment' => '快递发送备注']) + ->addColumn('send_datetime', 'string', ['limit' => 20, 'default' => '', 'null' => true, 'comment' => '快递发送时间']) + ->addColumn('status', 'integer', ['limit' => 1, 'default' => 1, 'null' => true, 'comment' => '发货商品状态(1使用,0禁用)']) + ->addColumn('deleted', 'integer', ['limit' => 1, 'default' => 0, 'null' => true, 'comment' => '发货删除状态(0未删,1已删)']) + ->addColumn('create_at', 'timestamp', ['default' => 'CURRENT_TIMESTAMP', 'null' => true, 'comment' => '创建时间']) ->addIndex('status', ['name' => 'idx_shop_order_send_status']) ->addIndex('deleted', ['name' => 'idx_shop_order_send_deleted']) ->addIndex('order_no', ['name' => 'idx_shop_order_send_order_no']) + ->addIndex('uuid', ['name' => 'idx_shop_order_send_uuid']) ->save(); // 修改主键长度 $this->table($table)->changeColumn('id', 'integer', ['limit' => 20, 'identity' => true]); } + }