Hello again, ok, it could work this way:
import sqlalchemy as sa
from alembic import context
config = context.config
engine = sa.engine_from_config(
config.get_section(config.config_ini_section),
prefix='sqlalchemy.')
engine.echo = False
metadata = sa.MetaData(engine)
token = sa.Table('Token', metadata, autoload=True)
upd =
token.update(values={token.c.Count:token.c.Count+1}).where(token.c.TokenId
> 200)
engine.execute(upd)
...but I wonder, if there would be less lines of code...
Kind regards
Cornelius
Am 01.04.2012 08:48, schrieb Cornelius Koelbel:
> Hi,
>
> yesterday i stumbled upon alembic to upgrade the database schema. It
> looks very promising and I am evaluating what is possible with what kind
> of effort.
>
> What would be the easiest way to update table contents within alembic
> like this:
>
> update test set name='Fred' where name='fred'
>
> ...or one day even more complex! ;-)
>
> Kind regards
> Cornelius
>
signature.asc
Description: OpenPGP digital signature
