45 lines
1.3 KiB
Lua
45 lines
1.3 KiB
Lua
local skynet = require "skynet"
|
||
local oo = require "Class"
|
||
local tableDef = require "TableDef"
|
||
local TableUser = oo.class(tableDef)
|
||
|
||
--表名
|
||
TableUser.TableName = "test_user"
|
||
|
||
--主键
|
||
TableUser.PrimaryKey =
|
||
{
|
||
{ fieldsName = "UserID" , fieldsStartPosition = 100000 }
|
||
}
|
||
|
||
--索引
|
||
TableUser.Index =
|
||
{
|
||
{ indexFields = "UserID" , IndexName = "UserIDIndex" }
|
||
}
|
||
|
||
--表字段
|
||
TableUser.Fields =
|
||
{
|
||
--[[
|
||
下面一条数据代表一个字段
|
||
参数字段信息:
|
||
参数1:字段名称 ,
|
||
参数2:字段具体值 ,可能是数字、字符串和表
|
||
参数3:数据库类型
|
||
参数4:字段特性
|
||
参数5:字段备注信息
|
||
]]
|
||
|
||
{"UserID", 0 , "int(10)" , "not null" , "数据库ID" } ,
|
||
{"Account", "" , "char(32)" , "not null" ,"帐号" } ,
|
||
{"Pwd", "" , "char(32)", "not null" ,"密码" } ,
|
||
{"NickName", "" , "char(32)" , "not null" ,"昵称" } ,
|
||
{"RegTime", "" , "datetime(0)", "not null" , "注册时间" } ,
|
||
{"RegIP", "" , "char(32)", "not null" , "注册IP" } ,
|
||
{"LastLoginTime", "" , "datetime(0)", "not null" , "上一次登陆时间" } ,
|
||
{"LastExitTime", "" , "datetime(0)", "not null" , "上一次退出时间" } ,
|
||
{"LastLoginIP", "" , "char(32)", "not null" , "上一次登陆IP" } ,
|
||
}
|
||
|
||
return TableUser |