"""added user_data to several entities

Revision ID: bdcdbb4b5b3f
Revises: cea0e48abb5a
Create Date: 2023-03-08 19:55:37.167491

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

# revision identifiers, used by Alembic.
revision = 'bdcdbb4b5b3f'
down_revision = 'cea0e48abb5a'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('branches', sa.Column('user_data', postgresql.JSONB(astext_type=sa.Text()), nullable=True))
    op.add_column('branches', sa.Column('user_data_ci', postgresql.JSONB(astext_type=sa.Text()), nullable=True))
    op.add_column('branches', sa.Column('user_data_dev', postgresql.JSONB(astext_type=sa.Text()), nullable=True))
    op.add_column('flows', sa.Column('user_data', postgresql.JSONB(astext_type=sa.Text()), nullable=True))
    op.add_column('projects', sa.Column('user_data', postgresql.JSONB(astext_type=sa.Text()), nullable=True))
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('projects', 'user_data')
    op.drop_column('flows', 'user_data')
    op.drop_column('branches', 'user_data_dev')
    op.drop_column('branches', 'user_data_ci')
    op.drop_column('branches', 'user_data')
    # ### end Alembic commands ###
