@@ -0,0 +1,625 @@
+#!/usr/bin/env python2%0A%0Afrom __future__ import unicode_literals%0A%0Aimport oursql%0Afrom copy import copy%0A%0Aimport settings%0Afrom data import Base, engine%0A%0A%0Aif __name__ == '__main__':%0A    s = copy(settings.database)%0A    s.pop('db')%0A    connection = oursql.Connection(**s)%0A    cursor = connection.cursor()%0A%0A    try:%0A        cursor.execute('DROP DATABASE %7B%7D'.format(settings.database%5B'db'%5D))%0A    except oursql.ProgrammingError:  # database doesn't exist%0A        pass%0A    cursor.execute('CREATE DATABASE %7B%7D CHARACTER SET utf8 COLLATE utf8_bin'%0A                   .format(settings.database%5B'db'%5D))%0A%0A    Base.metadata.create_all(engine)%0A

Add database (re-)creation module