| 1 | [[PageOutline(2)]] |
| 2 | |
| 3 | = Trac Database Schema: Notification |
| 4 | |
| 5 | The TracNotification module stores notification event subscriptions in the database. |
| 6 | |
| 7 | == Table `subscription` |
| 8 | ||'''Table'''||'''Key'''|| |
| 9 | ||''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 | Stores if a subscription rule always/never applies for a certain user, at what priority and using what distribution method/format. |
| 24 | |
| 25 | Use the `trac.notification.model.Subscription` model class to access this table. |
| 26 | |
| 27 | See [browser:psuter/trac/notification/model.py@advanced-notification-subscriptions#/ trac.notification.model.Subscription] |
| 28 | |
| 29 | == Table `subscription_attribute` |
| 30 | ||'''Table'''||'''Key'''|| |
| 31 | ||''subscription_attribute''||''id''|| |
| 32 | |
| 33 | ||'''Columns'''||'''Type'''||'''Notes'''|| |
| 34 | ||''id''||`auto_increment`|| || |
| 35 | ||''sid''|| || The session ID of the subscriber. || |
| 36 | ||''authenticated''||`int`|| `1` for authenticated session IDs, `0` for anonymous session IDs || |
| 37 | ||''class''|| || The name of the Python class that stored this subscription attribute. || |
| 38 | ||''realm''|| || The realm of this subscription (e.g. `ticket`). || |
| 39 | ||''target''|| || The target of this subscription (e.g. a ticket id). || |
| 40 | |
| 41 | Stores attributes to identify the target resource(s) of a subscription (e.g. a watched ticket's id, wiki page filters, joined groups, etc.) |
| 42 | |
| 43 | Use the `trac.notification.model.SubscriptionAttribute` model class to access this table. |
| 44 | |
| 45 | See [browser:psuter/trac/notification/model.py@advanced-notification-subscription-attributes#/ trac.notification.model.SubscriptionAttribute] |