diff options
author | Kim Alvefur <zash@zash.se> | 2013-10-28 23:19:47 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2013-10-28 23:19:47 +0100 |
commit | 136139f068145195233ed7aeb444d1a9bb45f7d4 (patch) | |
tree | 87de86f913945fe82d5539f8be6f5a92d82b3f44 /util | |
parent | 6c769838e9a81a145796cb447c03967f5c6fdb7a (diff) | |
download | prosody-136139f068145195233ed7aeb444d1a9bb45f7d4.tar.gz prosody-136139f068145195233ed7aeb444d1a9bb45f7d4.zip |
util.sql: Allow columns to be marked the primary key
Diffstat (limited to 'util')
-rw-r--r-- | util/sql.lua | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/util/sql.lua b/util/sql.lua index 736417bb..7c9743e1 100644 --- a/util/sql.lua +++ b/util/sql.lua @@ -262,6 +262,7 @@ function engine:_create_table(table) for i,col in ipairs(table.c) do sql = sql.."`"..col.name.."` "..col.type; if col.nullable == false then sql = sql.." NOT NULL"; end + if col.primary_key == true then sql = sql.." PRIMARY KEY"; end if i ~= #table.c then sql = sql..", "; end end sql = sql.. ");" |