mod_storage_sql2: Use MEDIUMTEXT fields for value columns (ie TEXT on non-MySQL)
authorKim Alvefur <zash@zash.se>
Wed, 30 Oct 2013 13:33:15 +0000 (14:33 +0100)
committerKim Alvefur <zash@zash.se>
Wed, 30 Oct 2013 13:33:15 +0000 (14:33 +0100)
plugins/mod_storage_sql2.lua

index 4148024e720f4fc0b7dd48fb51172761ef1b2434..dcd7a45a5d81550bd9566b76077f8037c08f493e 100644 (file)
@@ -35,7 +35,7 @@ local function create_table()
                Column { name="store", type="TEXT", nullable=false };
                Column { name="key", type="TEXT", nullable=false };
                Column { name="type", type="TEXT", nullable=false };
-               Column { name="value", type="TEXT", nullable=false };
+               Column { name="value", type="MEDIUMTEXT", nullable=false };
                Index { name="prosody_index", "host", "user", "store", "key" };
        };
        engine:transaction(function()
@@ -72,7 +72,7 @@ local function create_table()
                Column { name="when", type="INTEGER", nullable=false }; -- timestamp
                Column { name="with", type="TEXT", nullable=false }; -- related id
                Column { name="type", type="TEXT", nullable=false };
-               Column { name="value", type=params.driver == "MySQL" and "MEDIUMTEXT" or "TEXT", nullable=false };
+               Column { name="value", type="MEDIUMTEXT", nullable=false };
                Index { name="prosodyarchive_index", "host", "user", "store", "key" };
        };
        engine:transaction(function()