Bug 619236 - Set user_version in generated permissions.sqlite for tests. r=sicking
authorMounir Lamouri <mounir.lamouri@gmail.com>
Thu, 23 Aug 2012 11:39:41 -0700
changeset 103233 82eea30b2963d3e621dd11214b6958cdd0e1c044
parent 103232 41f9eeefbee7a6fd9ba4be0d199a6758edba5456
child 103234 53f3963dedc01f50f36a94c39f9110622f1f2040
push id13890
push userryanvm@gmail.com
push dateThu, 23 Aug 2012 23:50:55 +0000
treeherdermozilla-inbound@e137f28dfe70 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssicking
bugs619236
milestone17.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 619236 - Set user_version in generated permissions.sqlite for tests. r=sicking
build/automation.py.in
testing/mozbase/mozprofile/mozprofile/permissions.py
--- a/build/automation.py.in
+++ b/build/automation.py.in
@@ -259,16 +259,19 @@ class Automation(object):
       raise SyntaxError(lineno + 1, "missing primary location")
 
     return locations
 
   def setupPermissionsDatabase(self, profileDir, permissions):
     # Open database and create table
     permDB = sqlite3.connect(os.path.join(profileDir, "permissions.sqlite"))
     cursor = permDB.cursor();
+
+    cursor.execute("PRAGMA user_version=3");
+
     # SQL copied from nsPermissionManager.cpp
     cursor.execute("""CREATE TABLE moz_hosts (
        id INTEGER PRIMARY KEY,
        host TEXT,
        type TEXT,
        permission INTEGER,
        expireType INTEGER,
        expireTime INTEGER,
--- a/testing/mozbase/mozprofile/mozprofile/permissions.py
+++ b/testing/mozbase/mozprofile/mozprofile/permissions.py
@@ -226,16 +226,19 @@ class Permissions(object):
                 self._locations.read(locations)
 
     def write_db(self, locations):
         """write permissions to the sqlite database"""
 
         # Open database and create table
         permDB = sqlite3.connect(os.path.join(self._profileDir, "permissions.sqlite"))
         cursor = permDB.cursor();
+
+        cursor.execute("PRAGMA user_version=3");
+
         # SQL copied from
         # http://mxr.mozilla.org/mozilla-central/source/extensions/cookie/nsPermissionManager.cpp
         cursor.execute("""CREATE TABLE IF NOT EXISTS moz_hosts (
            id INTEGER PRIMARY KEY,
            host TEXT,
            type TEXT,
            permission INTEGER,
            expireType INTEGER,