diff options
author | Kim Alvefur <zash@zash.se> | 2013-11-11 23:28:53 +0100 |
---|---|---|
committer | Kim Alvefur <zash@zash.se> | 2013-11-11 23:28:53 +0100 |
commit | 9ad69a00f43a989ec472c1e9d5f9f17931e52dc8 (patch) | |
tree | b88d7632488c3ce383c723be20db538dd29ade44 | |
parent | 2109d4abf0a687b620a3c21bfb1930bb291fa249 (diff) | |
parent | 2d85f0a5e613260372a457ad910136ce8c7a778f (diff) | |
download | prosody-9ad69a00f43a989ec472c1e9d5f9f17931e52dc8.tar.gz prosody-9ad69a00f43a989ec472c1e9d5f9f17931e52dc8.zip |
Merge 0.10->trunk
-rw-r--r-- | plugins/mod_storage_sql2.lua | 2 | ||||
-rw-r--r-- | util/sql.lua | 7 |
2 files changed, 5 insertions, 4 deletions
diff --git a/plugins/mod_storage_sql2.lua b/plugins/mod_storage_sql2.lua index 824ab859..e03b1fd6 100644 --- a/plugins/mod_storage_sql2.lua +++ b/plugins/mod_storage_sql2.lua @@ -44,7 +44,7 @@ local function create_table() 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 --git a/util/sql.lua b/util/sql.lua index 07b1a4e0..a7f46421 100644 --- a/util/sql.lua +++ b/util/sql.lua @@ -264,13 +264,14 @@ function engine:_create_table(table) 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"; |