We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 83d6372 commit 40cdfa7Copy full SHA for 40cdfa7
1 file changed
database/migrations/schema/004_update_results.sql
@@ -0,0 +1,13 @@
1
+update vote set
2
+ results = jsonb_set(results, '{against_percentage}', to_jsonb((results->>'against')::real / (results->>'allowed_voters')::real * 100))
3
+where results is not null
4
+and results != 'null'::jsonb
5
+and not results ? 'against_percentage';
6
+
7
8
+ results = jsonb_set(results, '{pending_voters}', '[]'::jsonb)
9
10
11
+and not results ? 'pending_voters';
12
13
+---- create above / drop below ----
0 commit comments