# HG changeset patch # User Kim Alvefur # Date 1384208933 -3600 # Node ID eda2556aa1397957f313d174924f2bc296782e85 # Parent 7051dc27e531dfb6e0a38d978bbc99a10a95f260# Parent 6865eecaf5a5d85373acb5fd8e58e914bebc78c9 Merge 0.10->trunk diff -r 7051dc27e531 -r eda2556aa139 plugins/mod_storage_sql2.lua --- a/plugins/mod_storage_sql2.lua Sun Nov 10 23:10:46 2013 +0000 +++ b/plugins/mod_storage_sql2.lua Mon Nov 11 23:28:53 2013 +0100 @@ -44,7 +44,7 @@ local ProsodyArchiveTable = Table { name="prosodyarchive"; - Column { name="sort_id", type="INTEGER", primary_key=true, auto_increment=true, nullable=false }; + Column { name="sort_id", type="INTEGER", primary_key=true, auto_increment=true }; Column { name="host", type="TEXT", nullable=false }; Column { name="user", type="TEXT", nullable=false }; Column { name="store", type="TEXT", nullable=false }; diff -r 7051dc27e531 -r eda2556aa139 util/sql.lua --- a/util/sql.lua Sun Nov 10 23:10:46 2013 +0000 +++ b/util/sql.lua Mon Nov 11 23:28:53 2013 +0100 @@ -264,13 +264,14 @@ if col_type == "MEDIUMTEXT" and self.params.driver ~= "MySQL" then col_type = "TEXT"; -- MEDIUMTEXT is MySQL-specific end + if col.auto_increment == true and self.params.driver == "PostgreSQL" then + col_type = "BIGSERIAL"; + end 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 col.auto_increment == true then - if self.params.driver == "PostgreSQL" then - sql = sql.." SERIAL"; - elseif self.params.driver == "MySQL" then + if self.params.driver == "MySQL" then sql = sql.." AUTO_INCREMENT"; elseif self.params.driver == "SQLite3" then sql = sql.." AUTOINCREMENT";