Fix repo downgrade SQL.