Skip to content

Commit

Permalink
Merge pull request #33 from fedora-infra/feature/stls
Browse files Browse the repository at this point in the history
Add a column to optionally associate stls with a badge.
  • Loading branch information
ralphbean committed Jul 11, 2014
2 parents 3c076b9 + 91a8353 commit 2082a78
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
24 changes: 24 additions & 0 deletions alembic/versions/508367dcbbb5_add_an_stl_column_fo.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""Add an stl column for badges.
Revision ID: 508367dcbbb5
Revises: 2879ed5a6297
Create Date: 2014-07-11 09:36:33.211281
"""

# revision identifiers, used by Alembic.
revision = '508367dcbbb5'
down_revision = '2879ed5a6297'

from alembic import op
import sqlalchemy as sa


def upgrade():
op.add_column('badges', sa.Column('stl', sa.Unicode(128)))


def downgrade():
# Downgrade will fail if using SQLite. The transaction will
# be rolled back as per env.py.
op.drop_column('badges', 'stl')
1 change: 1 addition & 0 deletions tahrir_api/model.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ class Badge(DeclarativeBase):
id = Column(Unicode(128), primary_key=True, default=badge_id_default)
name = Column(Unicode(128), nullable=False, unique=True)
image = Column(Unicode(128), nullable=False)
stl = Column(Unicode(128))
description = Column(Unicode(128), nullable=False)
criteria = Column(Unicode(128), nullable=False)
authorizations = relationship("Authorization", backref="badge")
Expand Down

0 comments on commit 2082a78

Please sign in to comment.