summaryrefslogtreecommitdiff
path: root/src/mailman/database/base.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/mailman/database/base.py')
-rw-r--r--src/mailman/database/base.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/mailman/database/base.py b/src/mailman/database/base.py
index 8c426f8cf..c4b04b329 100644
--- a/src/mailman/database/base.py
+++ b/src/mailman/database/base.py
@@ -94,6 +94,15 @@ class SABaseDatabase:
"""
pass
+ def _prepare(self, url):
+ """Prepare the database for creation.
+
+ Some database backends need to do so me prep work before letting Storm
+ create the database. For example, we have to touch the SQLite .db
+ file first so that it has the proper file modes.
+ """
+ pass
+
# XXX Abhilash removed teh _prepare() method. Is that because SA takes
# care of this for us? If so, then the comment below must be updated.
# For reference, the SQLite bug is marked "won't fix".
@@ -102,6 +111,7 @@ class SABaseDatabase:
"""See `IDatabase`."""
# Calculate the engine url.
url = expand(config.database.url, config.paths)
+ self._prepare(url)
log.debug('Database url: %s', url)
# XXX By design of SQLite, database file creation does not honor
# umask. See their ticket #1193: