summaryrefslogtreecommitdiff
path: root/lib/sqlalchemy/dialects/sqlite/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'lib/sqlalchemy/dialects/sqlite/base.py')
-rw-r--r--lib/sqlalchemy/dialects/sqlite/base.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/lib/sqlalchemy/dialects/sqlite/base.py b/lib/sqlalchemy/dialects/sqlite/base.py
index bc7f7fce4..d6a713988 100644
--- a/lib/sqlalchemy/dialects/sqlite/base.py
+++ b/lib/sqlalchemy/dialects/sqlite/base.py
@@ -583,6 +583,7 @@ from ... import types as sqltypes
from ... import util
from ...engine import default
from ...engine import reflection
+from ...sql import ColumnElement
from ...sql import compiler
from ...types import BLOB # noqa
from ...types import BOOLEAN # noqa
@@ -1034,6 +1035,8 @@ class SQLiteDDLCompiler(compiler.DDLCompiler):
colspec = self.preparer.format_column(column) + " " + coltype
default = self.get_column_default_string(column)
if default is not None:
+ if isinstance(column.server_default.arg, ColumnElement):
+ default = "(" + default + ")"
colspec += " DEFAULT " + default
if not column.nullable: