"""Rename gltf_preview/gltf_production tessellation settings keys.

Revision ID: 062
Revises: 061
"""
from alembic import op

revision = "062"
down_revision = "061"
branch_labels = None
depends_on = None


def upgrade() -> None:
    op.execute("UPDATE system_settings SET key = 'scene_linear_deflection'   WHERE key = 'gltf_preview_linear_deflection'")
    op.execute("UPDATE system_settings SET key = 'scene_angular_deflection'  WHERE key = 'gltf_preview_angular_deflection'")
    op.execute("UPDATE system_settings SET key = 'render_linear_deflection'  WHERE key = 'gltf_production_linear_deflection'")
    op.execute("UPDATE system_settings SET key = 'render_angular_deflection' WHERE key = 'gltf_production_angular_deflection'")


def downgrade() -> None:
    op.execute("UPDATE system_settings SET key = 'gltf_preview_linear_deflection'    WHERE key = 'scene_linear_deflection'")
    op.execute("UPDATE system_settings SET key = 'gltf_preview_angular_deflection'   WHERE key = 'scene_angular_deflection'")
    op.execute("UPDATE system_settings SET key = 'gltf_production_linear_deflection' WHERE key = 'render_linear_deflection'")
    op.execute("UPDATE system_settings SET key = 'gltf_production_angular_deflection' WHERE key = 'render_angular_deflection'")
