aboutsummaryrefslogtreecommitdiffstats
path: root/util/sql.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2013-11-11 23:28:53 +0100
committerKim Alvefur <zash@zash.se>2013-11-11 23:28:53 +0100
commit7ab93b50b0c0f8592fb036cdc45e3b8a620d2f91 (patch)
treeb88d7632488c3ce383c723be20db538dd29ade44 /util/sql.lua
parentc71bff87a6601ab98221fed02f8c9b2a97a45d6f (diff)
parentb8218da015567c95dbc958d4d3885cf3ccb36050 (diff)
downloadprosody-7ab93b50b0c0f8592fb036cdc45e3b8a620d2f91.tar.gz
prosody-7ab93b50b0c0f8592fb036cdc45e3b8a620d2f91.zip
Merge 0.10->trunk
Diffstat (limited to 'util/sql.lua')
-rw-r--r--util/sql.lua7
1 files changed, 4 insertions, 3 deletions
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";