HomeServer/lualib-src/Server-main/Lib/DB/TableUser.lua
2024-11-20 15:41:37 +08:00

45 lines
1.3 KiB
Lua
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

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