开发者

How do I migrate model changes in pylons/sqlalchemy?

开发者 https://www.devze.com 2023-01-16 22:49 出处:网络
I created a simple model and then mapped it to a class using sqlalchemy in pylons: tag_table = schema.Table(\'tag\', meta.metadata,

I created a simple model and then mapped it to a class using sqlalchemy in pylons:

tag_table = schema.Table('tag', meta.metadata,
    schema.Column('id', types.Integer,
                  schema.Sequence('tag_seq_id', optional=True),
                  primary_key=True),
    schema.Column('name', types.Unicode(20), nullable=False, unique=True),
)

class Tag(object):
    pass
orm.mapper(Tag, tag_table)

When I run paster setup-app development.ini I can see that the table is created but if I add another column to my table, how do I migrate the only column 开发者_运维问答that I've added?

I've seen this migration in Rails and Django but is there something similar for Pylons?


You can try this tool: sqlalchemy-migrate

0

精彩评论

暂无评论...
验证码 换一张
取 消