1 from sqlalchemy
import *
4 from sqlalchemy
.ext
.declarative
import declarative_base
5 TableBase
= declarative_base(bind
=migrate_engine
)
9 __tablename__
= 'users'
10 id = Column(Integer
, primary_key
=True)
11 name
= Column(Unicode(length
=20), nullable
=False)
13 class OpenID(TableBase
):
14 __tablename__
= 'openid'
15 openid
= Column(Unicode(length
=255), primary_key
=True)
16 user_id
= Column(Integer
, ForeignKey('users.id'))
20 User
.__table__
.create()
21 OpenID
.__table__
.create()
24 OpenID
.__table__
.drop()