summaryrefslogtreecommitdiff
path: root/src/leap
diff options
context:
space:
mode:
authorVictor Shyba <victor1984@riseup.net>2017-08-10 04:33:15 -0300
committerKali Kaneko <kali@leap.se>2017-08-11 18:52:09 -0400
commit11f0f9b2ffe2eb58e3eb9e875a1003bc7302a2d2 (patch)
tree4a8f39042e76e3d5fe563860fdd1bb084b225c8c /src/leap
parent05b5c10b6c2eeb5a05963c1489e576a5e12a89c9 (diff)
[feature] add namespace to local blobs db table
This column will keep track of namespace locally. -- Related: #8882
Diffstat (limited to 'src/leap')
-rw-r--r--src/leap/soledad/client/_db/blobs.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/leap/soledad/client/_db/blobs.py b/src/leap/soledad/client/_db/blobs.py
index 87209570..9e97fe8c 100644
--- a/src/leap/soledad/client/_db/blobs.py
+++ b/src/leap/soledad/client/_db/blobs.py
@@ -485,6 +485,11 @@ def _init_blob_table(conn):
"blob_id PRIMARY KEY, "
"payload BLOB)")
conn.execute(maybe_create)
+ columns = [row[1] for row in conn.execute("pragma"
+ " table_info(blobs)").fetchall()]
+ if 'namespace' not in columns:
+ # migrate
+ conn.execute('ALTER TABLE blobs ADD COLUMN namespace TEXT')
def _sqlcipherInitFactory(fun):