add salutation table as specified in DataTypeSalutation
This commit is contained in:
parent
ec5da322a9
commit
97d1cd7090
3 changed files with 20 additions and 2 deletions
18
data/dbrepo/versions/003_add_salutation_table.py
Normal file
18
data/dbrepo/versions/003_add_salutation_table.py
Normal file
|
@ -0,0 +1,18 @@
|
|||
from sqlalchemy import MetaData, Table, Column, types
|
||||
from migrate import *
|
||||
|
||||
def upgrade():
|
||||
# Upgrade operations go here. Don't create your own engine; use the engine
|
||||
# named 'migrate_engine' imported from migrate.
|
||||
meta = MetaData(bind=migrate_engine)
|
||||
t_salutation = Table(
|
||||
'salutation', meta,
|
||||
Column('id', types.Integer, primary_key=True),
|
||||
Column('name', types.Unicode(30), nullable=False, unique=True))
|
||||
t_salutation.create()
|
||||
|
||||
def downgrade():
|
||||
# Operations to reverse the above upgrade go here.
|
||||
meta = MetaData(bind=migrate_engine)
|
||||
t_salutation = Table('salutation', meta, autoload=True)
|
||||
t_salutation.drop()
|
Loading…
Add table
Add a link
Reference in a new issue