Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I migrate model changes in pylons/sqlalchemy?

Tags:

python

pylons

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?

like image 264
Marconi Avatar asked Sep 13 '26 17:09

Marconi


1 Answers

You can try this tool: sqlalchemy-migrate

like image 67
rubayeet Avatar answered Sep 16 '26 07:09

rubayeet



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!