init db fix

This commit is contained in:
Matthew Scragg 2013-10-04 16:52:41 -05:00
parent 1a08aade00
commit 694f1c2b5e

View file

@ -52,6 +52,13 @@ def init_db(dbname):
if not tbl in rdb.table_list().run(db):
rdb.table_create(tbl).run(db)
if not 'name' in rdb.table('users').index_list().run(db):
rdb.table('sites').indexCreate('name').run(db)
for i in ['username', 'email']:
if not i in rdb.table('users').index_list().run(db):
rdb.table('users').indexCreate(i).run(db)
s = Site()
if not s.get_by_name('_'):
s.create(name='_', repo='_')