"""add frame update times

Revision ID: afaee09a3222
Revises: f86bbf26d5a1
Create Date: 2025-11-26 12:24:15.234425

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'afaee09a3222'
down_revision = 'f86bbf26d5a1'
branch_labels = None
depends_on = None


def upgrade():
    op.add_column('frames', sa.Column('created_at', sa.TIMESTAMP(), server_default=sa.text("TIMEZONE('utc', CURRENT_TIMESTAMP)"), nullable=False))
    op.add_column('frames', sa.Column('updated_at', sa.TIMESTAMP(), nullable=True))
    op.add_column('frames', sa.Column('updated_by_id', sa.Integer(), nullable=True))
    op.add_column('frames', sa.Column('points_updated_at', sa.TIMESTAMP(), nullable=True))
    op.add_column('frames', sa.Column('grids_updated_at', sa.TIMESTAMP(), nullable=True))


def downgrade():
    op.drop_column('frames', 'created_at')
    op.drop_column('frames', 'updated_at')
    op.drop_column('frames', 'updated_by_id')
    op.drop_column('frames', 'points_updated_at')
    op.drop_column('frames', 'grids_updated_at')
