Spain has deployed its military to Ceuta after thousands of migrants overwhelmed police barricades.