"""prepaid_orgs

Revision: 0117
Revision ID: 4c92555fa6cb
Revises: 525735b60e4d
Create Date: 2018-03-13 16:23:15.009849

"""

# revision identifiers, used by Alembic.
revision = '4c92555fa6cb'
down_revision = '525735b60e4d'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa


def upgrade():
    op.add_column('organizations', sa.Column('is_prepaid', sa.Boolean(), nullable=True))
    op.add_column('organizations', sa.Column('prepaid_until', sa.DateTime(), nullable=True))
    op.add_column('organizations', sa.Column('max_allowed_users', sa.Integer(), nullable=True))
    op.execute("UPDATE organizations SET is_prepaid = false")


def downgrade():
    op.drop_column('organizations', 'is_prepaid')
    op.drop_column('organizations', 'prepaid_until')
    op.drop_column('organizations', 'max_allowed_users')
