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
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -1,5 +1,5 @@
|
|||
*~
|
||||
data/templates
|
||||
*.pyc
|
||||
data
|
||||
development.db
|
||||
pyalchemybiz/public/js/jquery.js
|
||||
|
|
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()
|
|
@ -36,7 +36,7 @@ sqlalchemy.echo = true
|
|||
sqlalchemy.convert_unicode = true
|
||||
|
||||
# settings for sqlalchemy-migrate
|
||||
migrate.repo.version = 2
|
||||
migrate.repo.version = 3
|
||||
migrate.repo.dir = %(here)s/data/dbrepo
|
||||
|
||||
# WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT*
|
||||
|
|
Loading…
Reference in a new issue