summaryrefslogtreecommitdiff
path: root/src/mailman/database/base.py
diff options
context:
space:
mode:
authorBarry Warsaw2014-09-22 19:19:13 -0400
committerBarry Warsaw2014-09-22 19:19:13 -0400
commit1a0d525074c57b337ba95aee1dd1ba880429aff2 (patch)
tree88e5c39aa46a4fcf68a1b8aab3ac778a7bf91efa /src/mailman/database/base.py
parent710277a7ec626980ed0107921346876e1a7b46be (diff)
downloadmailman-1a0d525074c57b337ba95aee1dd1ba880429aff2.tar.gz
mailman-1a0d525074c57b337ba95aee1dd1ba880429aff2.tar.zst
mailman-1a0d525074c57b337ba95aee1dd1ba880429aff2.zip
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: