first reimport from platal
[platal.git] / upgrade / 0.9.2 / notifs.sql
1 alter table aliases add index (type);
2 alter table auth_user_quick add column watch_flags set('contacts','mail') not null default 'contacts';
3 alter table auth_user_quick add column watch_last timestamp not null;
4 alter table auth_user_quick add index(watch_flags);
5
6 create table watch_cat (
7 id smallint not null auto_increment,
8 short varchar(40),
9 mail varchar(80),
10 frequent smallint(1) default 0,
11 primary key (id),
12 index (frequent)
13 );
14
15 insert into watch_cat VALUES(1,'Mise à jour de fiche', 'Ces camarades ont mis leur fiche à jour', 1);
16 insert into watch_cat VALUES(2,'Nouveaux inscrits', 'Ces camarades se sont inscrit', 0);
17 insert into watch_cat VALUES(3,'Décès', 'Ces camarades nous ont quitté', 0);
18
19 create table watch_ops (
20 uid smallint not null,
21 cid smallint not null,
22 known timestamp not null,
23 date date not null,
24 info varchar(255),
25 primary key (uid,cid),
26 index (known)
27 );
28
29 create table watch_sub (
30 uid smallint not null,
31 cid smallint not null,
32 primary key (uid,cid)
33 );
34
35 create table watch_nonins (
36 uid smallint not null,
37 ni_id smallint not null,
38 primary key (uid,ni_id)
39 );
40
41 create table watch_promo (
42 uid smallint not null,
43 promo smallint not null,
44 primary key (uid,promo)
45 );
46
47 replace into watch_sub
48 select u.user_id,id
49 from auth_user_md5 AS u
50 join watch_cat
51 where u.perms != 'non-inscrit';
52
53