HomeServer/lualib-src/Server-main/Lib/DB/TablePlayer.lua

40 lines
1.0 KiB
Lua
Raw Normal View History

2024-11-20 15:41:09 +08:00
local skynet = require "skynet"
local oo = require "Class"
local tableDef = require "TableDef"
local TablePlayer = oo.class(tableDef)
--表名
TablePlayer.TableName = "player"
--主键
TablePlayer.PrimaryKey =
{
{ fieldsName = "UserID" , fieldsStartPosition = 100000 }
}
--索引
TablePlayer.Index =
{
{ indexFields = "UserID" , IndexName = "UserIDIndex" }
}
--表字段
TablePlayer.Fields =
{
--[[
1 ,
2
3
4
5
]]
{"UserID", 0 , "int(10)" , "not null" , "数据库ID" } ,
{"BasicInfo", {} , "json" , "not null" ,"基础信息包括玩家的IP、登陆时间等" } ,
{"GameData", {} , "json" , "not null" ,"游戏数据" } ,
{"RefreshTime", {} , "timestamp" , "null default current_timestamp on update current_timestamp" ,"用户数据刷新时间" } ,
}
return TablePlayer