"""Adapt LicenseUsage to accept mb iso tokoens for Storage and Embeddings

Revision ID: 6a7743d08106
Revises: 9429f244f1a5
Create Date: 2024-10-07 06:04:39.424243

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '6a7743d08106'
down_revision = '9429f244f1a5'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('license_usage', schema=None) as batch_op:
        batch_op.add_column(sa.Column('storage_mb_used', sa.Integer(), nullable=True))
        batch_op.add_column(sa.Column('embedding_mb_used', sa.Integer(), nullable=True))
        batch_op.drop_column('storage_tokens_used')
        batch_op.drop_column('embedding_tokens_used')

    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    with op.batch_alter_table('license_usage', schema=None) as batch_op:
        batch_op.add_column(sa.Column('embedding_tokens_used', sa.INTEGER(), autoincrement=False, nullable=True))
        batch_op.add_column(sa.Column('storage_tokens_used', sa.INTEGER(), autoincrement=False, nullable=True))
        batch_op.drop_column('embedding_mb_used')
        batch_op.drop_column('storage_mb_used')

    # ### end Alembic commands ###
