1
0
Fork 0
mirror of https://we.phorge.it/source/phorge.git synced 2024-11-25 16:22:43 +01:00
phorge-phorge/resources/sql/autopatches/20161031.calendar.02.notifylog.sql
epriestley 6e6ae36dcf 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
2016-11-01 10:41:15 -07:00

8 lines
377 B
SQL

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};