From 928a957e70f8372a2232cdbe7ab405f7903f151c Mon Sep 17 00:00:00 2001 From: Martin Kleusberg Date: Sun, 2 Jun 2013 17:16:35 +0200 Subject: [PATCH] SqliteTypes: Allow non-numeric default values Fix the sqlb::Field class to support non-numeric default values by putting them in quotes. --- src/sqlitetypes.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/sqlitetypes.cpp b/src/sqlitetypes.cpp index db41a6e5..da26a4a4 100644 --- a/src/sqlitetypes.cpp +++ b/src/sqlitetypes.cpp @@ -15,7 +15,7 @@ QString Field::toString(const QString& indent, const QString& sep) const if(m_notnull) str += " NOT NULL"; if(!m_defaultvalue.isEmpty()) - str += " DEFAULT " + m_defaultvalue; + str += QString(" DEFAULT '%1'").arg(m_defaultvalue); if(!m_check.isEmpty()) str += " CHECK(" + m_check + ")"; if(m_autoincrement)