From 1e3a0e0ca0c58ae740424fa6cf239f2dba5dc592 Mon Sep 17 00:00:00 2001 From: Elrond Date: Sun, 1 Apr 2012 19:55:15 +0200 Subject: [PATCH] Switch JSONEncoded from VARCHAR to TEXT The JSON fields are really "dumb stuff in here" fields. They are not intended to get indexed or anything. And they can get large. For example the exif_all field in one of my simple tests is nearly 7 kB large. Although VARCHAR might work, TEXT feels just better as the storage type. --- mediagoblin/db/sql/extratypes.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/mediagoblin/db/sql/extratypes.py b/mediagoblin/db/sql/extratypes.py index 8e078f14..f2304af0 100644 --- a/mediagoblin/db/sql/extratypes.py +++ b/mediagoblin/db/sql/extratypes.py @@ -15,7 +15,7 @@ # along with this program. If not, see . -from sqlalchemy.types import TypeDecorator, Unicode, VARCHAR +from sqlalchemy.types import TypeDecorator, Unicode, TEXT import json @@ -50,7 +50,7 @@ class PathTupleWithSlashes(TypeDecorator): class JSONEncoded(TypeDecorator): "Represents an immutable structure as a json-encoded string." - impl = VARCHAR + impl = TEXT def process_bind_param(self, value, dialect): if value is not None: -- 2.25.1