mozilla / teach-api

A basic API to store data for learning.mozilla.org
2 stars 11 forks source link

batch-update all old clubs so that the new required columns all have content #59

Closed Pomax closed 8 years ago

Pomax commented 8 years ago

Right now an old club will not have values set for the new schema fields, which causes "this field needs content!" errors for about nine fields when editing older club applications. Since this also affects hitting the approve or decline buttons, it would be most useful to application administrators if we were able to do a batch-update for all old applications so that the new required fields all have an "n/a" value of some sort.

/cc @KGorr @hannahkane

Pomax commented 8 years ago

Going with "unknown" makes a whole lot of sense, so the batch update would be:

UPDATE clubs_club
SET
  age_range='unknown',
  club_size='unknown',
  club_topics='unknown',
  frequency='unknown',
  hosting_reason='unknown',
  how_they_heard='unknown',
  member_occupation='unknown',
  occupation='unknown',
  venue='unknown',
  intent='start'
WHERE
  occupation is null;

@kgorr do you see any fields missing in this list that you've gotten errors for?

Pomax commented 8 years ago

@gideonthomas not a traditional review, but if this update looks right we can:

and then close this issue.

Pomax commented 8 years ago

For some reason, teach-api production does not have the correct schema for clubs, and restarting the dyno does not seem to run the sh startup.sh it should be: no migrations seem to be getting applied

Pomax commented 8 years ago

apparently there was a lingering missing credly schema. That has been applied, and the prod teach-api schema is now correct. we have ~9 applications that as a consequence do not have the new fields even though they could have.