Page MenuHomePhabricator

D5309.diff
No OneTemporary

D5309.diff

diff --git a/keyserver/src/scripts/populate-policies-acknowledgment.js b/keyserver/src/scripts/populate-policies-acknowledgment.js
new file mode 100644
--- /dev/null
+++ b/keyserver/src/scripts/populate-policies-acknowledgment.js
@@ -0,0 +1,18 @@
+// @flow
+
+import { dbQuery, SQL } from '../database/database.js';
+import { policyTypes } from '../lib/facts/policies.js';
+import { main } from './utils.js';
+
+// this function populate accepted policy for existing users
+async function populatePoliciesAcknowledgment() {
+ const time = Date.now();
+
+ await dbQuery(SQL`
+ INSERT IGNORE INTO policy_acknowledgments (policy, user, date, confirmed)
+ SELECT ${policyTypes.tosAndPrivacyPolicy}, id, ${time}, 1
+ FROM users;
+ `);
+}
+
+main([populatePoliciesAcknowledgment]);

File Metadata

Mime Type
text/plain
Expires
Sun, Dec 22, 7:29 AM (52 m, 45 s)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2690561
Default Alt Text
D5309.diff (793 B)

Event Timeline