# HG changeset patch # User Kim Alvefur # Date 1383125075 -3600 # Node ID 544ca3d945969c7f21e73137306ccaa72390977c # Parent ea6a3adb6a697ebef6c2733d163a31646f44522a util.sql: Rewrite MEDIUMTEXT to TEXT for drivers other than MySQL diff -r ea6a3adb6a69 -r 544ca3d94596 util/sql.lua --- a/util/sql.lua Tue Oct 29 11:43:49 2013 +0100 +++ b/util/sql.lua Wed Oct 30 10:24:35 2013 +0100 @@ -260,7 +260,11 @@ function engine:_create_table(table) local sql = "CREATE TABLE `"..table.name.."` ("; for i,col in ipairs(table.c) do - sql = sql.."`"..col.name.."` "..col.type; + local col_type = col.type; + if col_type == "MEDIUMTEXT" and self.params.driver ~= "MySQL" then + col_type = "TEXT"; -- MEDIUMTEXT is MySQL-specific + 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