Skip to content

Commit

Permalink
Featured project flag, for #433
Browse files Browse the repository at this point in the history
  • Loading branch information
jace committed Jun 5, 2019
1 parent ac4d09c commit 0348b00
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
4 changes: 4 additions & 0 deletions funnel/models/project.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,10 @@ class Project(UuidMixin, BaseScopedNameMixin, db.Model):
inherit_sections = db.Column(db.Boolean, default=True, nullable=False)
part_labels = db.Column('labels', JsonDict, nullable=False, server_default='{}')

#: Featured project flag. This can only be set by website editors, not
#: project editors or profile admins.
featured = db.Column(db.Boolean, default=False, nullable=False)

venues = db.relationship('Venue', cascade='all, delete-orphan',
order_by='Venue.seq', collection_class=ordering_list('seq', count_from=1))
labels = db.relationship('Label', cascade='all, delete-orphan',
Expand Down
24 changes: 24 additions & 0 deletions migrations/versions/ea20c403b240_featured_project_flag.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
"""Featured project flag
Revision ID: ea20c403b240
Revises: c38fa391613f
Create Date: 2019-06-05 12:38:15.928874
"""

# revision identifiers, used by Alembic.
revision = 'ea20c403b240'
down_revision = 'c38fa391613f'

from alembic import op
import sqlalchemy as sa


def upgrade():
op.add_column('project', sa.Column('featured', sa.Boolean(),
nullable=False, server_default=sa.sql.expression.false()))
op.alter_column('project', 'featured', server_default=None)


def downgrade():
op.drop_column('project', 'featured')

0 comments on commit 0348b00

Please sign in to comment.