"""size bytes columns to biginteger

Revision ID: 7deba16dcb54
Revises: 4e82a2e1d16f
Create Date: 2026-02-11 18:00:51.008471

"""

import sqlalchemy as sa
from alembic import op

# revision identifiers, used by Alembic.
revision = "7deba16dcb54"
down_revision = "4e82a2e1d16f"
branch_labels = None
depends_on = None


def upgrade() -> None:
  # ### commands auto generated by Alembic - please adjust! ###
  op.alter_column(
    "graph_backups",
    "original_size_bytes",
    existing_type=sa.INTEGER(),
    type_=sa.BigInteger(),
    existing_nullable=False,
  )
  op.alter_column(
    "graph_backups",
    "compressed_size_bytes",
    existing_type=sa.INTEGER(),
    type_=sa.BigInteger(),
    existing_nullable=False,
  )
  op.alter_column(
    "graph_backups",
    "encrypted_size_bytes",
    existing_type=sa.INTEGER(),
    type_=sa.BigInteger(),
    existing_nullable=False,
  )
  op.alter_column(
    "graph_files",
    "file_size_bytes",
    existing_type=sa.INTEGER(),
    type_=sa.BigInteger(),
    existing_nullable=False,
  )
  op.alter_column(
    "graph_tables",
    "total_size_bytes",
    existing_type=sa.INTEGER(),
    type_=sa.BigInteger(),
    existing_nullable=True,
  )
  op.alter_column(
    "graph_usage",
    "storage_bytes",
    existing_type=sa.DOUBLE_PRECISION(precision=53),
    type_=sa.BigInteger(),
    existing_nullable=True,
  )
  op.alter_column(
    "source_files",
    "file_size_bytes",
    existing_type=sa.INTEGER(),
    type_=sa.BigInteger(),
    existing_nullable=True,
  )
  # ### end Alembic commands ###


def downgrade() -> None:
  # ### commands auto generated by Alembic - please adjust! ###
  op.alter_column(
    "source_files",
    "file_size_bytes",
    existing_type=sa.BigInteger(),
    type_=sa.INTEGER(),
    existing_nullable=True,
  )
  op.alter_column(
    "graph_usage",
    "storage_bytes",
    existing_type=sa.BigInteger(),
    type_=sa.DOUBLE_PRECISION(precision=53),
    existing_nullable=True,
  )
  op.alter_column(
    "graph_tables",
    "total_size_bytes",
    existing_type=sa.BigInteger(),
    type_=sa.INTEGER(),
    existing_nullable=True,
  )
  op.alter_column(
    "graph_files",
    "file_size_bytes",
    existing_type=sa.BigInteger(),
    type_=sa.INTEGER(),
    existing_nullable=False,
  )
  op.alter_column(
    "graph_backups",
    "encrypted_size_bytes",
    existing_type=sa.BigInteger(),
    type_=sa.INTEGER(),
    existing_nullable=False,
  )
  op.alter_column(
    "graph_backups",
    "compressed_size_bytes",
    existing_type=sa.BigInteger(),
    type_=sa.INTEGER(),
    existing_nullable=False,
  )
  op.alter_column(
    "graph_backups",
    "original_size_bytes",
    existing_type=sa.BigInteger(),
    type_=sa.INTEGER(),
    existing_nullable=False,
  )
  # ### end Alembic commands ###
