"""Add Tags and Social Profiles

Revision ID: 578ce9f8d1
Revises: 29ef29bfbe43
Create Date: 2017-12-07 19:34:45.949358

"""

# revision identifiers, used by Alembic.
revision = '578ce9f8d1'
down_revision = '29ef29bfbe43'

from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
from sqlalchemy.types import Text

def upgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.add_column('organization', sa.Column('social_profiles', postgresql.JSONB(astext_type=Text()), nullable=True))
    op.add_column('organization', sa.Column('tags', postgresql.JSONB(astext_type=Text()), nullable=True))
    ### end Alembic commands ###


def downgrade():
    ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('organization', 'tags')
    op.drop_column('organization', 'social_profiles')
    ### end Alembic commands ###

Add migration for tags/social profiles
Add migration for tags/social profiles

Reading the documentation for [Flask-Migrate][1] seems to imply that
the way to do migrations for us is a two step process:

python app.py db migrate --message "Some message here"

then, to test the migration:

python app.py db upgrade

Make sure to commit the migration.

[1]: https://flask-migrate.readthedocs.io/en/latest/
