# HG changeset patch # User Kim Alvefur # Date 1382998787 -3600 # Node ID 1237f9cc312302a234abedc3c34375af37c5aefb # Parent cbc25ae1eea0679c45e8ce8a9eacfc64fbb330de util.sql: Allow columns to be marked the primary key diff -r cbc25ae1eea0 -r 1237f9cc3123 util/sql.lua --- a/util/sql.lua Mon Oct 28 23:18:54 2013 +0100 +++ b/util/sql.lua Mon Oct 28 23:19:47 2013 +0100 @@ -262,6 +262,7 @@ 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.. ");"