aboutsummaryrefslogtreecommitdiffstats
path: root/util
diff options
context:
space:
mode:
Diffstat (limited to 'util')
-rw-r--r--util/sql.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/util/sql.lua b/util/sql.lua
index 972940f7..736417bb 100644
--- a/util/sql.lua
+++ b/util/sql.lua
@@ -251,6 +251,9 @@ function engine:_create_index(index)
elseif self.params.driver == "MySQL" then
sql = sql:gsub("`([,)])", "`(20)%1");
end
+ if index.unique then
+ sql = sql:gsub("^CREATE", "CREATE UNIQUE");
+ end
--print(sql);
return self:execute(sql);
end