/
Working with crop data

Working with crop data

crop_id in crop spreadsheets indicates the crop_id in the beta database. Keep in mind that the same crop will have different crop_ids on the dev/beta/production database. While creating migrations, crop_common_name + crop_genus + crop_specie + farm_id (farm_id will be null for all default crops) should be used as unique identifier instead of crop_id.

To get crop_common_name + crop_genus + crop_specie + farm_id of each crop, developers can use the crop_id on spreadsheets to look up individual crops in beta database. To create a migration, crop_id need to be replaced by looked up crop_common_name + crop_genus + crop_specie.

Migration example:
LiteFarm/packages/api/db/migration/20211109193450_update_default_crop_hs_code.js at integration · LiteFarmOrg/LiteFarm

LiteFarm/packages/api/db/seeds/seedData/cropHscodeByCropCommonNameV2.json at integration · LiteFarmOrg/LiteFarm

crop image batch processing tool:

ImageMagick – Mastering Digital Image Alchemy

GitHub - h2non/imaginary: Fast, simple, scalable, Docker-ready HTTP microservice for high-level image processing

 

Related content