| 1 | [[PageOutline(2)]] |
| 2 | |
| 3 | = Trac Database Schema: Notification |
| 4 | |
| 5 | The TracNotification module stores notification event subscriptions in the database. |
| 6 | |
| 7 | == Table `notify_subscription` |
| 8 | ||'''Table'''||'''Key'''|| |
| 9 | ||''notify_subscription''||''id''|| |
| 10 | |
| 11 | ||'''Columns'''||'''Type'''||'''Notes'''|| |
| 12 | ||''id''||`auto_increment`|| || |
| 13 | ||''time''||`int64`|| || |
| 14 | ||''changetime''||`int64`|| || |
| 15 | ||''class''|| || The name of the Python class that stored this subscription. || |
| 16 | ||''sid''|| || The [wiki:TracDev/DatabaseSchema/Common#Tablesession session] ID of the subscriber. || |
| 17 | ||''authenticated''||`int`|| `1` for authenticated session IDs, `0` for anonymous session IDs || |
| 18 | ||''distributor''|| || Identifies the distributor to used for this subscription (e.g. `email`) || |
| 19 | ||''format''|| || Identifies the MIME type to be used for this subscription (e.g. `text/plain` or `text/html`) || |
| 20 | ||''priority''||`int`||Precedence level of this subscription. E.g. `1` overrules `2`. || |
| 21 | ||''adverb''|| ||`always` or `never`|| |
| 22 | |
| 23 | ||'''Indices'''|| |
| 24 | ||''sid'', ''authenticated''|| |
| 25 | ||''class''|| |
| 26 | |
| 27 | Stores if a subscription rule always/never applies for a certain user, at what priority and using what distribution method/format. |
| 28 | |
| 29 | Use the `trac.notification.model.Subscription` model class to access this table. |
| 30 | |
| 31 | Note that this table does not store an (email) address, but the commonly used subscription tuple has an additional item `addr`. Usually such tuples that correspond to entries in this DB table contain a `addr` of `None`. Other tuples may contain an (email) address (e.g. retrieved from a ticket CC field) but are missing the `sid` item instead. |
| 32 | |
| 33 | See [browser:trunk/trac/notification/model.py#/ trac.notification.model.Subscription] |
| 34 | |