@@ -0,0 +1,997 @@
+from datetime import datetime%0A%0Afrom sqlalchemy import MetaData, Column, ForeignKey, Table%0Afrom sqlalchemy import DateTime, Integer, Unicode%0A%0Ametadata = MetaData()%0A%0A%0Abadge_table = Table('badge', metadata,%0A    Column('id', Integer, primary_key=True),%0A    Column('create_time', DateTime, default=datetime.utcnow),%0A    Column('title', Unicode(40), nullable=False),%0A    Column('color', Unicode(7), nullable=False))%0A%0A%0Auser_badges_table = Table('user_badges', metadata,%0A    Column('id', Integer, primary_key=True),%0A    Column('badge_id', Integer, ForeignKey('badge.id'),%0A           nullable=False),%0A    Column('user_id', Integer, ForeignKey('user.id'),%0A           nullable=False),%0A    Column('create_time', DateTime, default=datetime.utcnow),%0A    Column('creator_id', Integer, ForeignKey('user.id'), nullable=False))%0A%0A%0Adef upgrade(migrate_engine):%0A    metadata.bind = migrate_engine%0A    badge_table.create()%0A    user_badges_table.create()%0A%0A%0Adef downgrade(migrate_engine):%0A    raise NotImplementedError()%0A

Add migration script for user badges