From 74834350516bb6e8edbd02ecd01cbe28478704f9 Mon Sep 17 00:00:00 2001 From: dg <dg@51575b47-30f0-44d4-a5cc-537603b46e54> Date: Wed, 4 Aug 2010 19:21:04 +0000 Subject: [PATCH] hum git-svn-id: http://svn.net-core.org/repos/t-engine4@980 51575b47-30f0-44d4-a5cc-537603b46e54 --- game/engine/PlayerProfile.lua | 10 ++++------ game/modules/tome/data/profiles/tome/tables.lua | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/game/engine/PlayerProfile.lua b/game/engine/PlayerProfile.lua index 77e3df72c7..128de34b4e 100644 --- a/game/engine/PlayerProfile.lua +++ b/game/engine/PlayerProfile.lua @@ -68,21 +68,19 @@ end local function constructTableQuery(name, def) local fields, keys = {}, {} for fname, fdef in pairs(def) do - if fname ~= "__options" then - fields[#fields+1] = {position=fdef.position, sql=fname.." "..fdef.type} - if fdef.primary_key then keys[#keys+1] = {position=fdef.position, sql="PRIMARY KEY ("..fname..")"} end - end + fields[#fields+1] = {position=fdef.position, sql=fname.." "..fdef.type} + if fdef.primary_key then keys[#keys+1] = {position=fdef.position, sql="PRIMARY KEY ("..fname..")"} end end table.sort(fields, function(a, b) return a.position < b.position end) table.sort(keys, function(a, b) return a.position < b.position end) -- Make the statement - local fs = {} + local fs = { "uuid CHAR(36) NOT NULL" } -- Add fields for i = 1, #fields do fs[#fs+1] = fields[i].sql end -- Add keys for i = 1, #keys do fs[#fs+1] = keys[i].sql end - return "CREATE TABLE "..name.." ("..table.concat(fs, ",")..")" + return "CREATE TABLE "..name.." ("..table.concat(fs, ", ")..")" end ------------------------------------------------------------ diff --git a/game/modules/tome/data/profiles/tome/tables.lua b/game/modules/tome/data/profiles/tome/tables.lua index d3e774281d..a3c0f21ca1 100644 --- a/game/modules/tome/data/profiles/tome/tables.lua +++ b/game/modules/tome/data/profiles/tome/tables.lua @@ -9,7 +9,7 @@ return { }, statements = { - setAllowBuild = [[REPLACE INTO allow_build VALUES (:what, 1)]], + setAllowBuild = [[REPLACE INTO allow_build (what, allowed) VALUES (:what, 1)]], }, }, -- GitLab