def setup_tables
@db << "create table meta (meta_key text, meta_value text)"
@db[:meta] << {:meta_key => 'schema', :meta_value => SCHEMA_VERSION}
@db << "create table commits (id integer, sha text, author_date integer)"
@db << "create table nodes (id integer, path text, type text)"
@db << "create table branches (id integer, ref text, commit_id integer)"
@db << "create table commit_branches (commit_id integer, branch_id integer)"
@db << "create table commit_nodes (commit_id integer, node_id integer, node_sha string)"
end