[Zope3-checkins] CVS: Zope3/src/zodb - db.py:1.2.4.2

Jeremy Hylton jeremy@zope.com
Fri, 24 Jan 2003 17:28:01 -0500


Update of /cvs-repository/Zope3/src/zodb
In directory cvs.zope.org:/tmp/cvs-serv23645

Modified Files:
      Tag: new-pickle-branch
	db.py 
Log Message:
Call YAGNI on storing release information in the database version.

The database version is a simple magic number that needs to get
changed when the database record (aka pickle) format changes.


=== Zope3/src/zodb/db.py 1.2.4.1 => 1.2.4.2 ===
--- Zope3/src/zodb/db.py:1.2.4.1	Tue Jan 21 11:20:38 2003
+++ Zope3/src/zodb/db.py	Fri Jan 24 17:27:29 2003
@@ -41,8 +41,8 @@
     of managing objects is done by the connections.
     """
 
-    # the database version number
-    version = (4, 0, 0, "alpha", 2)
+    # the database version number, a 4-byte string
+    version = "DB01"
     
     def __init__(self, storage, pool_size=7, cache_size=400):
         """Create an object database.
@@ -93,9 +93,8 @@
         ver = self._storage.getVersion()
         if ver is None:
             self._storage.setVersion(self.version)
-        else:
-            # No version compatibility checking yet ...
-            pass
+        elif ver != self.version:
+            raise StorageVersionError(self.version, ver)
 
     def _closeConnection(self, connection):
         """Return a connection to the pool"""