add salutation table as specified in DataTypeSalutation

This commit is contained in:
Jan Dittberner 2009-03-14 22:47:20 +01:00
parent ec5da322a9
commit 97d1cd7090
3 changed files with 20 additions and 2 deletions

2
.gitignore vendored
View file

@ -1,5 +1,5 @@
*~ *~
data/templates
*.pyc *.pyc
data
development.db development.db
pyalchemybiz/public/js/jquery.js pyalchemybiz/public/js/jquery.js

View 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()

View file

@ -36,7 +36,7 @@ sqlalchemy.echo = true
sqlalchemy.convert_unicode = true sqlalchemy.convert_unicode = true
# settings for sqlalchemy-migrate # settings for sqlalchemy-migrate
migrate.repo.version = 2 migrate.repo.version = 3
migrate.repo.dir = %(here)s/data/dbrepo migrate.repo.dir = %(here)s/data/dbrepo
# WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT* # WARNING: *THE LINE BELOW MUST BE UNCOMMENTED ON A PRODUCTION ENVIRONMENT*