|
@@ -10,20 +10,20 @@ final class InitDatabase extends AbstractMigration
|
|
public function up(): void
|
|
public function up(): void
|
|
{
|
|
{
|
|
$this->table('user', [ 'id' => false, 'primary_key' => [ 'id' ]])
|
|
$this->table('user', [ 'id' => false, 'primary_key' => [ 'id' ]])
|
|
- ->addColumn('id', 'biginteger', [ 'identity' => true, 'signed' => false])
|
|
|
|
|
|
+ ->addColumn('id', 'integer', [ 'comment' => '用户ID', 'identity' => true, 'signed' => false, 'null' => false ])
|
|
->addColumn('user_name', 'string', [ 'comment' => '用户名' ])
|
|
->addColumn('user_name', 'string', [ 'comment' => '用户名' ])
|
|
->addColumn('email', 'string', [ 'comment' => 'E-Mail' ])
|
|
->addColumn('email', 'string', [ 'comment' => 'E-Mail' ])
|
|
->addIndex([ 'email' ], [ 'unique' => true ])
|
|
->addIndex([ 'email' ], [ 'unique' => true ])
|
|
->addColumn('pass', 'string', [ 'comment' => '登录密码' ])
|
|
->addColumn('pass', 'string', [ 'comment' => '登录密码' ])
|
|
->addColumn('passwd', 'string', [ 'comment' => '节点密码' ])
|
|
->addColumn('passwd', 'string', [ 'comment' => '节点密码' ])
|
|
- ->addColumn('uuid', 'string', [ 'comment' => 'UUID' ])
|
|
|
|
|
|
+ ->addColumn('uuid', 'uuid', [ 'comment' => '用户UUID', 'null' => false ])
|
|
->addIndex([ 'uuid' ], [ 'unique' => true ])
|
|
->addIndex([ 'uuid' ], [ 'unique' => true ])
|
|
->addColumn('t', 'biginteger', [ 'comment' => '最后使用时间', 'default' => 0, 'signed' => false])
|
|
->addColumn('t', 'biginteger', [ 'comment' => '最后使用时间', 'default' => 0, 'signed' => false])
|
|
->addColumn('u', 'biginteger', [ 'comment' => '账户当前上传流量', 'default' => 0, 'signed' => false])
|
|
->addColumn('u', 'biginteger', [ 'comment' => '账户当前上传流量', 'default' => 0, 'signed' => false])
|
|
->addColumn('d', 'biginteger', [ 'comment' => '账户当前下载流量', 'default' => 0, 'signed' => false])
|
|
->addColumn('d', 'biginteger', [ 'comment' => '账户当前下载流量', 'default' => 0, 'signed' => false])
|
|
->addColumn('transfer_total', 'biginteger', [ 'comment' => '账户累计使用流量', 'default' => 0, 'signed' => false])
|
|
->addColumn('transfer_total', 'biginteger', [ 'comment' => '账户累计使用流量', 'default' => 0, 'signed' => false])
|
|
->addColumn('transfer_enable', 'biginteger', [ 'comment' => '账户当前可用流量', 'default' => 0, 'signed' => false ])
|
|
->addColumn('transfer_enable', 'biginteger', [ 'comment' => '账户当前可用流量', 'default' => 0, 'signed' => false ])
|
|
- ->addColumn('port', 'integer', [ 'comment' => '用户端口' ])
|
|
|
|
|
|
+ ->addColumn('port', 'smallinteger', [ 'comment' => '用户端口', 'null' => false ])
|
|
->addColumn('last_detect_ban_time', 'datetime', [ 'comment' => '最后一次被封禁的时间', 'default' => '1989-06-04 00:05:00' ])
|
|
->addColumn('last_detect_ban_time', 'datetime', [ 'comment' => '最后一次被封禁的时间', 'default' => '1989-06-04 00:05:00' ])
|
|
->addColumn('all_detect_number', 'integer', [ 'comment' => '累计违规次数', 'default' => 0 ])
|
|
->addColumn('all_detect_number', 'integer', [ 'comment' => '累计违规次数', 'default' => 0 ])
|
|
->addColumn('last_check_in_time', 'biginteger', [ 'comment' => '最后签到时间', 'default' => 0, 'signed' => false ])
|
|
->addColumn('last_check_in_time', 'biginteger', [ 'comment' => '最后签到时间', 'default' => 0, 'signed' => false ])
|
|
@@ -33,15 +33,15 @@ final class InitDatabase extends AbstractMigration
|
|
->addColumn('ref_by', 'biginteger', [ 'comment' => '邀请人ID', 'default' => '0', 'signed' => false ])
|
|
->addColumn('ref_by', 'biginteger', [ 'comment' => '邀请人ID', 'default' => '0', 'signed' => false ])
|
|
->addColumn('method', 'string', [ 'comment' => 'SS/SSR加密方式', 'default' => 'rc4-md5' ])
|
|
->addColumn('method', 'string', [ 'comment' => 'SS/SSR加密方式', 'default' => 'rc4-md5' ])
|
|
->addColumn('reg_ip', 'string', [ 'comment' => '注册IP', 'default' => '127.0.0.1' ])
|
|
->addColumn('reg_ip', 'string', [ 'comment' => '注册IP', 'default' => '127.0.0.1' ])
|
|
- ->addColumn('node_speedlimit', 'decimal', [ 'comment' => '每个连接限速', 'default' => 0 ])
|
|
|
|
- ->addColumn('node_iplimit', 'integer', [ 'comment' => '同时可连接IP数', 'default' => 0 ])
|
|
|
|
|
|
+ ->addColumn('node_speedlimit', 'double', [ 'comment' => '用户节点限速', 'default' => 0, 'null' => false ])
|
|
|
|
+ ->addColumn('node_iplimit', 'smallinteger', [ 'comment' => '同时可连接IP数', 'default' => 0, 'null' => false ])
|
|
->addColumn('node_connector', 'integer', [ 'comment' => '同时可使用连接数', 'default' => 0 ])
|
|
->addColumn('node_connector', 'integer', [ 'comment' => '同时可使用连接数', 'default' => 0 ])
|
|
->addColumn('is_admin', 'boolean', [ 'comment' => '是否管理员', 'default' => false ])
|
|
->addColumn('is_admin', 'boolean', [ 'comment' => '是否管理员', 'default' => false ])
|
|
->addColumn('im_type', 'integer', [ 'comment' => '联系方式类型', 'default' => 1 ])
|
|
->addColumn('im_type', 'integer', [ 'comment' => '联系方式类型', 'default' => 1 ])
|
|
->addColumn('im_value', 'string', [ 'comment' => '联系方式', 'default' => '' ])
|
|
->addColumn('im_value', 'string', [ 'comment' => '联系方式', 'default' => '' ])
|
|
->addColumn('last_day_t', 'biginteger', [ 'comment' => '今天之前已使用的流量', 'default' => 0 ])
|
|
->addColumn('last_day_t', 'biginteger', [ 'comment' => '今天之前已使用的流量', 'default' => 0 ])
|
|
->addColumn('sendDailyMail', 'boolean', [ 'comment' => '每日报告开关', 'default' => 0 ])
|
|
->addColumn('sendDailyMail', 'boolean', [ 'comment' => '每日报告开关', 'default' => 0 ])
|
|
- ->addColumn('class', 'integer', [ 'comment' => '用户等级', 'default' => 0 ])
|
|
|
|
|
|
+ ->addColumn('class', 'integer', [ 'comment' => '用户等级', 'default' => 0, 'signed' => false, 'null' => false ])
|
|
->addColumn('class_expire', 'datetime', [ 'comment' => '等级过期时间', 'default' => '1989-06-04 00:05:00' ])
|
|
->addColumn('class_expire', 'datetime', [ 'comment' => '等级过期时间', 'default' => '1989-06-04 00:05:00' ])
|
|
->addColumn('expire_in', 'datetime', [ 'default' => '2099-06-04 00:05:00' ])
|
|
->addColumn('expire_in', 'datetime', [ 'default' => '2099-06-04 00:05:00' ])
|
|
->addColumn('theme', 'string', [ 'comment' => '网站主题' ])
|
|
->addColumn('theme', 'string', [ 'comment' => '网站主题' ])
|
|
@@ -49,7 +49,7 @@ final class InitDatabase extends AbstractMigration
|
|
->addIndex([ 'ga_token' ], [ 'unique' => true ])
|
|
->addIndex([ 'ga_token' ], [ 'unique' => true ])
|
|
->addColumn('ga_enable', 'integer', [ 'default' => '0' ])
|
|
->addColumn('ga_enable', 'integer', [ 'default' => '0' ])
|
|
->addColumn('remark', 'text', [ 'comment' => '备注', 'default' => '' ])
|
|
->addColumn('remark', 'text', [ 'comment' => '备注', 'default' => '' ])
|
|
- ->addColumn('node_group', 'integer', [ 'comment' => '节点分组', 'default' => 0 ])
|
|
|
|
|
|
+ ->addColumn('node_group', 'integer', [ 'comment' => '用户等级', 'default' => 0, 'signed' => false, 'null' => false ])
|
|
->addColumn('protocol', 'string', [ 'comment' => 'SS/SSR协议方式', 'default' => 'origin' ])
|
|
->addColumn('protocol', 'string', [ 'comment' => 'SS/SSR协议方式', 'default' => 'origin' ])
|
|
->addColumn('protocol_param', 'string', [ 'default' => '' ])
|
|
->addColumn('protocol_param', 'string', [ 'default' => '' ])
|
|
->addColumn('obfs', 'string', [ 'comment' => 'SS/SSR混淆方式', 'default' => 'plain' ])
|
|
->addColumn('obfs', 'string', [ 'comment' => 'SS/SSR混淆方式', 'default' => 'plain' ])
|
|
@@ -78,7 +78,7 @@ final class InitDatabase extends AbstractMigration
|
|
->addColumn('sort', 'integer', [])
|
|
->addColumn('sort', 'integer', [])
|
|
->addColumn('traffic_rate', 'float', [ 'default' => 1 ])
|
|
->addColumn('traffic_rate', 'float', [ 'default' => 1 ])
|
|
->addColumn('node_class', 'integer', [ 'default' => 0 ])
|
|
->addColumn('node_class', 'integer', [ 'default' => 0 ])
|
|
- ->addColumn('node_speedlimit', 'decimal', [ 'default' => 0.00,'precision' => 12, 'scale' => 2 ])
|
|
|
|
|
|
+ ->addColumn('node_speedlimit', 'double', [ 'comment' => '节点限速', 'null' => false ])
|
|
->addColumn('node_connector', 'integer', [ 'default' => 0 ])
|
|
->addColumn('node_connector', 'integer', [ 'default' => 0 ])
|
|
->addColumn('node_bandwidth', 'biginteger', [ 'default' => 0 ])
|
|
->addColumn('node_bandwidth', 'biginteger', [ 'default' => 0 ])
|
|
->addColumn('node_bandwidth_limit', 'biginteger', [ 'default' => 0 ])
|
|
->addColumn('node_bandwidth_limit', 'biginteger', [ 'default' => 0 ])
|
|
@@ -251,7 +251,7 @@ final class InitDatabase extends AbstractMigration
|
|
->create();
|
|
->create();
|
|
|
|
|
|
$this->table('user_invite_code', [ 'id' => false, 'primary_key' => [ 'id' ]])
|
|
$this->table('user_invite_code', [ 'id' => false, 'primary_key' => [ 'id' ]])
|
|
- ->addColumn('id', 'biginteger', [ 'identity' => true,'signed' => false ])
|
|
|
|
|
|
+ ->addColumn('id', 'biginteger', [ 'identity' => true, 'signed' => false ])
|
|
->addColumn('code', 'string', [ ])
|
|
->addColumn('code', 'string', [ ])
|
|
->addIndex([ 'code' ], [ 'unique' => true ])
|
|
->addIndex([ 'code' ], [ 'unique' => true ])
|
|
->addColumn('user_id', 'biginteger', [ 'signed' => false ])
|
|
->addColumn('user_id', 'biginteger', [ 'signed' => false ])
|
|
@@ -297,7 +297,7 @@ final class InitDatabase extends AbstractMigration
|
|
->create();
|
|
->create();
|
|
|
|
|
|
$this->table('user_hourly_usage', [ 'id' => false, 'primary_key' => [ 'id' ]])
|
|
$this->table('user_hourly_usage', [ 'id' => false, 'primary_key' => [ 'id' ]])
|
|
- ->addColumn('id', 'biginteger', [ 'identity' => true,'signed' => false ])
|
|
|
|
|
|
+ ->addColumn('id', 'biginteger', [ 'identity' => true, 'signed' => false ])
|
|
->addColumn('user_id', 'biginteger', [ 'signed' => false ])
|
|
->addColumn('user_id', 'biginteger', [ 'signed' => false ])
|
|
->addColumn('traffic', 'biginteger', [])
|
|
->addColumn('traffic', 'biginteger', [])
|
|
->addColumn('hourly_usage', 'biginteger', [])
|
|
->addColumn('hourly_usage', 'biginteger', [])
|
|
@@ -307,7 +307,7 @@ final class InitDatabase extends AbstractMigration
|
|
->create();
|
|
->create();
|
|
|
|
|
|
$this->table('user_subscribe_log', [ 'id' => false, 'primary_key' => [ 'id' ]])
|
|
$this->table('user_subscribe_log', [ 'id' => false, 'primary_key' => [ 'id' ]])
|
|
- ->addColumn('id', 'biginteger', [ 'identity' => true,'signed' => false ])
|
|
|
|
|
|
+ ->addColumn('id', 'biginteger', [ 'identity' => true, 'signed' => false ])
|
|
->addColumn('user_name', 'string', [ 'comment' => '用户名' ])
|
|
->addColumn('user_name', 'string', [ 'comment' => '用户名' ])
|
|
->addColumn('user_id', 'biginteger', [ 'comment' => '用户 ID','signed' => false ])
|
|
->addColumn('user_id', 'biginteger', [ 'comment' => '用户 ID','signed' => false ])
|
|
->addColumn('email', 'string', [ 'comment' => '用户邮箱' ])
|
|
->addColumn('email', 'string', [ 'comment' => '用户邮箱' ])
|
|
@@ -320,7 +320,7 @@ final class InitDatabase extends AbstractMigration
|
|
->create();
|
|
->create();
|
|
|
|
|
|
$this->table('user_token', [ 'id' => false, 'primary_key' => [ 'id' ]])
|
|
$this->table('user_token', [ 'id' => false, 'primary_key' => [ 'id' ]])
|
|
- ->addColumn('id', 'biginteger', [ 'identity' => true,'signed' => false ])
|
|
|
|
|
|
+ ->addColumn('id', 'biginteger', [ 'identity' => true, 'signed' => false ])
|
|
->addColumn('token', 'string', [])
|
|
->addColumn('token', 'string', [])
|
|
->addColumn('user_id', 'biginteger', [ 'signed' => false ])
|
|
->addColumn('user_id', 'biginteger', [ 'signed' => false ])
|
|
->addColumn('create_time', 'biginteger', [ 'signed' => false ])
|
|
->addColumn('create_time', 'biginteger', [ 'signed' => false ])
|