"""Changed user to include is_super

Revision ID: b0ac53ab9d12
Revises: 090e8ec0fcad
Create Date: 2024-04-23 08:21:38.926298

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'b0ac53ab9d12'
down_revision = '090e8ec0fcad'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('user', schema=None) as batch_op:
        batch_op.add_column(sa.Column('is_super', sa.Boolean(), nullable=True))
        batch_op.add_column(sa.Column('confirmed_at', sa.DateTime(), nullable=True))
        batch_op.drop_constraint('user_tenant_id_fkey', type_='foreignkey')
        batch_op.create_foreign_key(None, 'tenant', ['tenant_id'], ['id'], referent_schema='public')

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('user', schema=None) as batch_op:
        batch_op.drop_constraint(None, type_='foreignkey')
        batch_op.create_foreign_key('user_tenant_id_fkey', 'tenant', ['tenant_id'], ['id'])
        batch_op.drop_column('confirmed_at')
        batch_op.drop_column('is_super')

    # ### end Alembic commands ###
