Skip to content

Instantly share code, notes, and snippets.

@mcrider
Created August 9, 2011 23:44
Show Gist options
  • Save mcrider/1135506 to your computer and use it in GitHub Desktop.
Save mcrider/1135506 to your computer and use it in GitHub Desktop.
Proposed schema for notifciation mailing list schema
<!--
*
* TABLE notification_mail_list
*
-->
<table name="notification_mail_list">
<field name="subscription_id" type="I8">
<KEY />
<AUTOINCREMENT/>
</field>
<field name="email" type="X">
<NOTNULL/>
</field>
<field name="confirmed" type="I1">
<NOTNULL/>
<DEFAULT VALUE="0"/>
</field>
<field name="context" type="I8">
<NOTNULL/>
</field>
<descr>Stores subscriptions to the notification mailing list</descr>
</table>
@asmecher
Copy link

asmecher commented Aug 9, 2011

  • subscription_id might cause confusion with subscriptions -- suggest notification_mail_list_id (little long but OK)
  • Needs unique index on email and context, I think
  • Might need a _settings table for this too, to store notification block / email settings. That would free up notification_settings to store only content attached to individual notifications.

@mcrider
Copy link
Author

mcrider commented Aug 10, 2011

I see your point about keeping notification_settings just for metadata for individual notifications, but those two things (blocked/emailed settings) are conceptually different than everything else. Maybe put them in a notification_options table? Or notification_subscription_settings?

@asmecher
Copy link

That's what I mean by a _settings table to go with notification_mail_list. Or I might've missed your point...?

@mcrider
Copy link
Author

mcrider commented Aug 10, 2011

i'm just talking semantics. A table called notification_mail_list_settings shouldn't contain anything to do with blocked notifications or what notifications get emailed out to subscribed users. It would have to be called something else. Don't worry, I think we're probably on the same page at different paragraphs here..

@asmecher
Copy link

OK, sounds good. Go for it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment