USE telc_certificates;

ALTER TABLE certificates
  ADD COLUMN reading_points INT NOT NULL DEFAULT 0 AFTER place_of_birth,
  ADD COLUMN listening_points INT NOT NULL DEFAULT 0 AFTER reading_points,
  ADD COLUMN writing_points INT NOT NULL DEFAULT 0 AFTER listening_points,
  ADD COLUMN speaking_points INT NOT NULL DEFAULT 0 AFTER writing_points;

UPDATE certificates
SET
  reading_points = total_points,
  listening_points = 0,
  writing_points = 0,
  speaking_points = 0
WHERE reading_points = 0
  AND listening_points = 0
  AND writing_points = 0
  AND speaking_points = 0;
