"""ical_tokens

Revision: 0104
Revision ID: 191bac60ca68
Revises: 575b3f3d895a
Create Date: 2017-09-22 17:14:58.733008

"""

# revision identifiers, used by Alembic.
revision = '191bac60ca68'
down_revision = '575b3f3d895a'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa


def upgrade():
    op.add_column('organizations', sa.Column('icalendar_token', sa.String(), nullable=True))
    op.create_index(op.f('ix_organizations_icalendar_token'), 'organizations', ['icalendar_token'], unique=True)

    op.add_column('users', sa.Column('icalendar_token', sa.String(), nullable=True))
    op.create_index(op.f('ix_users_icalendar_token'), 'users', ['icalendar_token'], unique=True)


def downgrade():
    op.drop_column('organizations', 'icalendar_token')
    op.drop_column('users', 'icalendar_token')
