diff --git a/bin/datastore.py b/bin/datastore.py index 2b787b2..13bcc0f 100644 --- a/bin/datastore.py +++ b/bin/datastore.py @@ -627,12 +627,12 @@ class Datastore: if include_archived: qry = """ - SELECT meta + SELECT meta, schema FROM public.projects; """ else: qry = """ - SELECT meta + SELECT meta, schema FROM public.projects WHERE NOT (meta->'archived')::boolean IS true """ @@ -642,7 +642,12 @@ class Datastore: cursor.execute(qry) results = cursor.fetchall() - return [r[0] for r in results if r[0]] + surveys = [] + for r in results: + if r[0]: + r[0]['schema'] = r[1] + surveys.append(r[0]) + return surveys # TODO Does this need tweaking on account of #246?