Skip to content

Replace int type by enum type whenever it's possible in the DB model

Some field use an int type where an enum would be far better :

  • int type has no sematic without a documentation "what does 5 mean ?"
  • int are errorprone since tyu can insert invalid velues ouside of the very specific values
  • int are poorly handled on the lon g term :some values are added then removed and sometimes reused
  • the admin controls are needlessly complexe to handle the int values : we have to add a very long help text to expose the int --> mening of each possible value

Enum on the other hand fit perfectly with how we handle thing internaly in the python code : we use python enums !

Affected fields :

  • Planet.detection_type
  • Planet.publication_status
  • other ???