Barry Warsaw pushed to branch master at mailman / Mailman
Commits: 7d21dbe2 by Mark Sapiro at 2016-12-15T21:05:09-08:00 Increase pendedkeyvalue table value column width. Also require docutils==0.12 to work around https://github.com/sphinx-doc/sphinx/issues/3212 - - - - - 5550ae7a by Barry Warsaw at 2016-12-23T22:46:54+00:00 Merge branch 'pendedkeyvalue' into 'master' Increase pendedkeyvalue table value column width. Closes #301 See merge request !225 - - - - - 3 changed files: - + src/mailman/database/alembic/versions/a46993b05703_increase_pendedkeyvalue_value_size.py - src/mailman/model/pending.py - tox.ini Changes: ===================================== src/mailman/database/alembic/versions/a46993b05703_increase_pendedkeyvalue_value_size.py ===================================== --- /dev/null +++ b/src/mailman/database/alembic/versions/a46993b05703_increase_pendedkeyvalue_value_size.py @@ -0,0 +1,27 @@ +"""increase pendedkeyvalue value size + +Revision ID: a46993b05703 +Revises: 448a93984c35 +Create Date: 2016-12-15 20:43:48.520837 + +""" + +from alembic import op +from mailman.database.types import SAUnicode, SAUnicodeLarge + + +# revision identifiers, used by Alembic. +revision = 'a46993b05703' +down_revision = '448a93984c35' + + +def upgrade(): + # Adding another rule can make the rule Hits/Misses too long for MySQL + # SaUnicode. + with op.batch_alter_table('pendedkeyvalue') as batch_op: + batch_op.alter_column('value', type_=SAUnicodeLarge) + + +def downgrade(): + with op.batch_alter_table('pendedkeyvalue') as batch_op: + batch_op.alter_column('value', type_=SAUnicode) ===================================== src/mailman/model/pending.py ===================================== --- a/src/mailman/model/pending.py +++ b/src/mailman/model/pending.py @@ -23,7 +23,7 @@ from lazr.config import as_timedelta from mailman.config import config from mailman.database.model import Model from mailman.database.transaction import dbconnection -from mailman.database.types import SAUnicode +from mailman.database.types import SAUnicode, SAUnicodeLarge from mailman.interfaces.pending import ( IPendable, IPended, IPendedKeyValue, IPendings) from mailman.utilities.datetime import now @@ -47,7 +47,7 @@ class PendedKeyValue(Model): id = Column(Integer, primary_key=True) key = Column(SAUnicode, index=True) - value = Column(SAUnicode, index=True) + value = Column(SAUnicodeLarge, index=True) pended_id = Column(Integer, ForeignKey('pended.id'), index=True) def __init__(self, key, value): ===================================== tox.ini ===================================== --- a/tox.ini +++ b/tox.ini @@ -43,6 +43,7 @@ commands = python setup.py build_sphinx deps: sphinx + docutils==0.12 [coverage] rcfile = {toxinidir}/coverage.ini View it on GitLab: https://gitlab.com/mailman/mailman/compare/00d59d69137848b87d021475b40c8e39fe190636...5550ae7a3d1f963492e2a45b7ac411428597a745
_______________________________________________ Mailman-checkins mailing list Mailman-checkins@python.org Unsubscribe: https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org