summaryrefslogtreecommitdiff
path: root/src/mailman/database/schema/mm_00000000000000_base.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman/database/schema/mm_00000000000000_base.py')
-rw-r--r--src/mailman/database/schema/mm_00000000000000_base.py21
1 files changed, 7 insertions, 14 deletions
diff --git a/src/mailman/database/schema/mm_00000000000000_base.py b/src/mailman/database/schema/mm_00000000000000_base.py
index d703088d6..ef448d620 100644
--- a/src/mailman/database/schema/mm_00000000000000_base.py
+++ b/src/mailman/database/schema/mm_00000000000000_base.py
@@ -21,14 +21,14 @@ from __future__ import absolute_import, print_function, unicode_literals
__metaclass__ = type
__all__ = [
- 'upgrade',
'post_reset',
'pre_reset',
+ 'upgrade',
]
-_migration_path = None
VERSION = '00000000000000'
+_helper = None
@@ -37,19 +37,12 @@ def upgrade(database, store, version, module_path):
database.load_schema(store, version, filename, module_path)
+
def pre_reset(store):
- global _migration_path
- # Save the entry in the Version table for the test suite reset. This will
- # be restored below.
- from mailman.model.version import Version
- result = store.find(Version, component=VERSION).one()
- # Yes, we abuse this field.
- _migration_path = result.version
+ global _helper
+ from mailman.testing.database import ResetHelper
+ _helper = ResetHelper(VERSION, store)
def post_reset(store):
- from mailman.model.version import Version
- # We need to preserve the Version table entry for this migration, since
- # its existence defines the fact that the tables have been loaded.
- store.add(Version(component='schema', version=VERSION))
- store.add(Version(component=VERSION, version=_migration_path))
+ _helper.restore(store)