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

40 lines
1.0 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 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