Show recent forum threads on the front page. Sucks, but.
[zzz-spline-forum.git] / migration / versions / 004_Add_forum_descriptions.py
1 from sqlalchemy import *
2 from migrate import *
3 import migrate.changeset
4
5 from sqlalchemy.ext.declarative import declarative_base
6 TableBase = declarative_base()
7
8 class Forum(TableBase):
9 __tablename__ = 'forums'
10 id = Column(Integer, primary_key=True, autoincrement=True, nullable=False)
11 name = Column(Unicode(133), nullable=False)
12 description = Column(Unicode(1024), nullable=False, default=u'', server_default=u'')
13 access_level = Column(Enum(u'normal', u'soapbox', u'archive', name='forums_access_level'), nullable=False, default=u'normal', server_default=u'normal')
14
15
16 def upgrade(migrate_engine):
17 TableBase.metadata.bind = migrate_engine
18
19 # populate_default gets all retarded I don't even
20 Forum.__table__.c.description.create(populate_default=False)
21
22 def downgrade(migrate_engine):
23 TableBase.metadata.bind = migrate_engine
24
25 Forum.__table__.c.description.drop()