DB support tracking welcome email sends

This commit is contained in:
Teemu Patja 2017-10-28 21:10:09 +03:00
parent 3a0293c056
commit 7aa8205115
No known key found for this signature in database
GPG Key ID: F5B7035E6580FD4C
4 changed files with 16 additions and 0 deletions

View File

@ -0,0 +1 @@
ALTER TABLE "public"."users" ADD COLUMN "welcome_email_sent" int DEFAULT '0';

View File

@ -552,6 +552,16 @@ FROM activity_feed_view
ORDER BY updated DESC
LIMIT 100;
-- :name get-new-users-for-welcome-email :? :*
-- :doc users who have not been sent a welcome email
SELECT
id,
login,
email,
name
FROM users
WHERE welcome_email_sent = 0;
-- :name usage-metrics-by-day :? :*
-- :doc data for usage metrics chart

View File

@ -37,3 +37,8 @@
[repo-id]
(jdbc/with-db-connection [con-db *db*]
(db/get-repo-owner {:repo_id repo-id})))
(defn get-new-users-for-welcome-email
[]
(jdbc/with-db-connection [con-db *db*]
(db/get-new-users-for-welcome-email)))