"""project_system_apps

Revision: 0223
Revision ID: 22b7db58107b
Revises: 0546e8ee2d53
Create Date: 2021-10-28 16:18:09.449514

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql


# revision identifiers, used by Alembic.
revision = '22b7db58107b'
down_revision = '0546e8ee2d53'
branch_labels = None
depends_on = None


def upgrade():
    op.add_column('projects', sa.Column('system_apps', postgresql.ARRAY(sa.String), nullable=True))
    op.execute("UPDATE projects SET system_apps = '{automations}'::text[]")


def downgrade():
    op.drop_column('projects', 'system_apps')
