Add a skeleton for Calendar notifications

Summary:
Ref T7931. I'm going to do this separate from existing infrastructure because:

  - events start at different times for different users;
  - I like the idea of being able to batch stuff (send one email about several upcoming events);
  - triggering on ghost/recurring events is a real complicated mess.

This puts a skeleton in place that finds all the events we need to notify about and writes some silly example bodies to stdout, marking that we notified users so they don't get notified again.

Test Plan:
Ran `bin/calendar notify`, got a "great" notification in the command output.

{F1891625}

Reviewers: chad

Reviewed By: chad

Maniphest Tasks: T7931

Differential Revision: https://secure.phabricator.com/D16783
This commit is contained in:
epriestley
2016-10-31 18:01:33 -07:00
parent a0ea31f47f
commit 6e6ae36dcf
10 changed files with 325 additions and 0 deletions

View File

@@ -0,0 +1,8 @@
CREATE TABLE {$NAMESPACE}_calendar.calendar_notification (
id INT UNSIGNED NOT NULL AUTO_INCREMENT PRIMARY KEY,
eventPHID VARBINARY(64) NOT NULL,
utcInitialEpoch INT UNSIGNED NOT NULL,
targetPHID VARBINARY(64) NOT NULL,
didNotifyEpoch INT UNSIGNED NOT NULL,
UNIQUE KEY `key_notify` (eventPHID, utcInitialEpoch, targetPHID)
) ENGINE=InnoDB, COLLATE {$COLLATE_TEXT};