Fixing big type column for output and in_context

Closes-Bug: #1438101

Change-Id: I10fe77e4a75aedaeacfd4ea0e9ead87cfe08612d
This commit is contained in:
Nikolay Mahotkin 2015-03-30 12:53:10 +03:00
parent aab6a7ab7e
commit be50bbf71f
2 changed files with 10 additions and 5 deletions

View File

@ -115,3 +115,11 @@ def JsonListType():
def LongText():
# TODO(rakhmerov): Need to do for postgres.
return sa.Text().with_variant(mysql.LONGTEXT(), 'mysql')
class JsonEncodedLongText(JsonEncoded):
impl = LongText()
def JsonLongDictType():
return MutableDict.as_mutable(JsonEncodedLongText)

View File

@ -114,10 +114,7 @@ class ActionExecution(Execution):
accepted = sa.Column(sa.Boolean(), default=False)
input = sa.Column(st.JsonDictType(), nullable=True)
# Note: Corresponds to MySQL 'LONGTEXT' type which is of unlimited size.
# TODO(rakhmerov): Change to LongText after refactoring.
output = sa.Column(st.JsonDictType(), nullable=True)
# output = sa.orm.deferred(sa.Column(st.LongText(), nullable=True))
output = sa.orm.deferred(sa.Column(st.JsonLongDictType(), nullable=True))
class WorkflowExecution(ActionExecution):
@ -150,7 +147,7 @@ class TaskExecution(Execution):
processed = sa.Column(sa.BOOLEAN, default=False)
# Data Flow properties.
in_context = sa.Column(st.JsonDictType())
in_context = sa.Column(st.JsonLongDictType())
published = sa.Column(st.JsonDictType())
# Runtime context like iteration_no of a repeater.