forked from hebcal/hebcal-web
-
Notifications
You must be signed in to change notification settings - Fork 0
/
hebcal.sql
82 lines (76 loc) · 2.8 KB
/
hebcal.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
CREATE TABLE yahrzeit (
id varchar(26) NOT NULL,
created datetime NOT NULL,
updated timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
ip varchar(16) DEFAULT NULL,
downloaded tinyint(1) NOT NULL DEFAULT '0',
contents JSON NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE hebcal_shabbat_email (
email_address varchar(200) NOT NULL,
email_id varchar(24) NOT NULL,
email_status varchar(16) NOT NULL,
email_created datetime NOT NULL,
email_updated timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
email_candles_zipcode varchar(5) DEFAULT NULL,
email_candles_city varchar(64) DEFAULT NULL,
email_candles_geonameid int DEFAULT NULL,
email_use_elevation tinyint(1) NOT NULL DEFAULT '0',
email_candles_havdalah tinyint DEFAULT NULL,
email_havdalah_tzeit tinyint(1) NOT NULL DEFAULT '0',
email_sundown_candles tinyint NOT NULL DEFAULT '18',
email_ip varchar(16) DEFAULT NULL,
PRIMARY KEY (email_address),
UNIQUE KEY email_id (email_id),
KEY email_status (email_status)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE hebcal_shabbat_bounce (
id int NOT NULL AUTO_INCREMENT,
email_address varchar(200) NOT NULL,
timestamp timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
std_reason varchar(16) DEFAULT NULL,
full_reason text,
deactivated tinyint(1) NOT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE yahrzeit_email (
id varchar(26) NOT NULL,
email_addr varchar(200) NOT NULL,
calendar_id varchar(26) NOT NULL,
sub_status varchar(16) NOT NULL,
created datetime NOT NULL,
updated timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
ip_addr varchar(16) DEFAULT NULL,
PRIMARY KEY (id),
KEY email_addr (email_addr),
KEY sub_status (sub_status)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
CREATE TABLE yahrzeit_sent (
id int NOT NULL AUTO_INCREMENT,
yahrzeit_id varchar(26) NOT NULL,
name_hash char(8) DEFAULT NULL,
num smallint NOT NULL,
hyear smallint NOT NULL,
sent_date datetime NOT NULL,
PRIMARY KEY (id),
UNIQUE KEY sent_key (yahrzeit_id, name_hash, num, hyear)
) ENGINE=InnoDB DEFAULT CHARSET=ascii;
CREATE TABLE yahrzeit_optout (
id int NOT NULL AUTO_INCREMENT,
email_id varchar(26) NOT NULL,
name_hash char(8) DEFAULT NULL,
num smallint NOT NULL,
deactivated tinyint(1) NOT NULL,
updated timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=ascii;
CREATE TABLE email_open (
id int NOT NULL AUTO_INCREMENT,
ts timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
msgid varchar(80) NOT NULL,
ip_addr varchar(16) NOT NULL,
loc varchar(80) DEFAULT NULL,
delta int DEFAULT NULL,
PRIMARY KEY (id)
) ENGINE=InnoDB DEFAULT CHARSET=ascii;