Mark Sapiro pushed to branch master at GNU Mailman / Mailman Core


Commits:
5deec34f by Mark Sapiro at 2019-04-28T17:36:28Z
Add alembic migration for tag column added to headermatch table.

Fixes #585

- - - - -
9da59491 by Mark Sapiro at 2019-04-28T18:30:45Z
Merge branch 'fix_585' into 'master'

Add alembic migration for tag column added to headermatch table.

Closes #585

See merge request mailman/mailman!501
- - - - -


1 changed file:

- + src/mailman/database/alembic/versions/2d2d0ef0828f_add_tag_column.py


Changes:

=====================================
src/mailman/database/alembic/versions/2d2d0ef0828f_add_tag_column.py
=====================================
@@ -0,0 +1,32 @@
+"""add tag column
+
+Revision ID: 2d2d0ef0828f
+Revises: 15401063d4e3
+Create Date: 2019-04-27 08:58:48.496854
+
+"""
+
+import sqlalchemy as sa
+
+from alembic import op
+from mailman.database.helpers import exists_in_db, is_sqlite
+from mailman.database.types import SAUnicode
+
+
+# revision identifiers, used by Alembic.
+revision = '2d2d0ef0828f'
+down_revision = '15401063d4e3'
+
+
+def upgrade():
+    if not exists_in_db(op.get_bind(), 'headermatch', 'tag'):
+        # SQLite may not have removed it when downgrading.
+        op.add_column(
+            'headermatch',
+            sa.Column('tag', type_=SAUnicode, nullable=True))
+
+
+def downgrade():
+    if not is_sqlite(op.get_bind()):
+        # diffcov runs with SQLite so this isn't covered.
+        op.drop_column('headermatch', 'tag')        # pragma: nocover



View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/b59182101846acf8227fbb3556d7c11e7acbf7e4...9da594913d24107323a3194ed86262b11f41f4ca

-- 
View it on GitLab: 
https://gitlab.com/mailman/mailman/compare/b59182101846acf8227fbb3556d7c11e7acbf7e4...9da594913d24107323a3194ed86262b11f41f4ca
You're receiving this email because of your account on gitlab.com.


_______________________________________________
Mailman-checkins mailing list
Mailman-checkins@python.org
Unsubscribe: 
https://mail.python.org/mailman/options/mailman-checkins/archive%40jab.org

Reply via email to