1 | """ |
---|
2 | Migration script to add a notify column to the request table. |
---|
3 | """ |
---|
4 | |
---|
5 | from sqlalchemy import * |
---|
6 | from migrate import * |
---|
7 | from migrate.changeset import * |
---|
8 | |
---|
9 | import logging |
---|
10 | log = logging.getLogger( __name__ ) |
---|
11 | |
---|
12 | metadata = MetaData( migrate_engine ) |
---|
13 | |
---|
14 | def upgrade(): |
---|
15 | print __doc__ |
---|
16 | metadata.reflect() |
---|
17 | |
---|
18 | Request_table = Table( "request", metadata, autoload=True ) |
---|
19 | c = Column( "notify", Boolean, default=False ) |
---|
20 | c.create( Request_table ) |
---|
21 | assert c is Request_table.c.notify |
---|
22 | |
---|
23 | def downgrade(): |
---|
24 | pass |
---|