I writing a widget which needs to store some state.
Most of the widget examples I have seen use the get_option() / set_option() for retrieving / saving state. This seems appropriate for widgets that have minimal state or are relatively static. For the widget I am contemplating, I think that having a dedicated table or two in the database will be the best way to maintain all the state.
I have found documentation for the $wpdb instance which acts as the interface to the database, and so it seems like it will be pretty easy to store and retrieve information once a database schema is established.
Is there a best practice for bootstrapping new tables into a WordPress installation? I have been looking at examples like the Next Gen Gallery, but I don't see where an author would put all the "create table" SQL statements.