Clarify our use of Text(length) and explicitly restrict it to mysql
Specify Text length only for mysql. Add a comment to explain
why we specify this long length.
SQLAlchemy mysql dialect uses the length argument of Text() to
choose a backing type. (TEXT, LONGTEXT, ...)
However Text() usually doesn't need the length argument and
some dialects (eg. postgresql) bail out with errors when it's given.
Also, remove the length argument from the model because it doesn't
serve any purposes.
Reviewed: https:/ /review. openstack. org/292016 /git.openstack. org/cgit/ openstack/ networking- midonet/ commit/ ?id=67e19d9ccc3 fbc48d44065754d c0e0825f7e307f
Committed: https:/
Submitter: Jenkins
Branch: stable/liberty
commit 67e19d9ccc3fbc4 8d44065754dc0e0 825f7e307f
Author: YAMAMOTO Takashi <email address hidden>
Date: Thu Dec 10 12:56:59 2015 +0900
Clarify our use of Text(length) and explicitly restrict it to mysql
Specify Text length only for mysql. Add a comment to explain
why we specify this long length.
SQLAlchemy mysql dialect uses the length argument of Text() to
choose a backing type. (TEXT, LONGTEXT, ...)
However Text() usually doesn't need the length argument and
some dialects (eg. postgresql) bail out with errors when it's given.
Also, remove the length argument from the model because it doesn't
serve any purposes.
Reference: http:// docs.sqlalchemy .org/en/ rel_1_0/ core/type_ basics. html#sqlalchemy .types. Text
Backport note: This commit was edited to exclude test_migrations part.
Closes-Bug: #1556090 aa1bb78ed75d8e4 3a9bf75103e 281cb4ec67ea4ea 9b0dbc1de9) neutron/ tests/unit/ db/test_ migrations. py
Change-Id: I78ae899df080a7
(cherry picked from commit 11e7099788233d7
Conflicts:
midonet/