Making device type id nullable in templates table.