diff options
author | Boris Kolpackov <boris@codesynthesis.com> | 2011-04-24 11:27:46 +0200 |
---|---|---|
committer | Boris Kolpackov <boris@codesynthesis.com> | 2011-04-24 11:27:46 +0200 |
commit | 451b564293dd9904b73d6d5b71eb3467be8f48a3 (patch) | |
tree | 9d0a9e49bb348754716f6b3efc181e12608f9e64 /odb/qt/basic/mysql/default-mapping.hxx | |
parent | 0a7d9a7dfba71809c88e0c497affbadbd6a4b061 (diff) |
Provide proper QString to MySQL type mapping
Diffstat (limited to 'odb/qt/basic/mysql/default-mapping.hxx')
-rw-r--r-- | odb/qt/basic/mysql/default-mapping.hxx | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/odb/qt/basic/mysql/default-mapping.hxx b/odb/qt/basic/mysql/default-mapping.hxx index de73007..8ffcafe 100644 --- a/odb/qt/basic/mysql/default-mapping.hxx +++ b/odb/qt/basic/mysql/default-mapping.hxx @@ -9,12 +9,11 @@ #include <QString> #include <QByteArray> -// Map QString to MySQL VARCHAR (56) by default. +// By default, map QString to MySQL TEXT for non-id and to VARCHAR(256) for +// id members. MySQL cannot have primary keys of the TEXT type. // -// @@ Temporary mapping until a solution for specifying primary key type -// has been implemented. -// -#pragma db value(QString) type("VARCHAR(56) NOT NULL") +#pragma db value(QString) type("TEXT NOT NULL") \ + id_type("VARCHAR(256) NOT NULL") // Map QByteArray to MySQL BLOB by default. Allow NULL values by default as // QByteArray provides a null representation. |