Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
/*
* Copyright 2026 LiteFarm.org
* This file is part of LiteFarm.
*
* LiteFarm is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* LiteFarm is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details, see <https://www.gnu.org/licenses/>.
*/

/**
* Aligns Venezuela's currency ISO code in the countries table between environments.
*
* Background: Venezuela redenominated in 2018, replacing the bolívar fuerte (VEF)
* with the bolívar soberano (VES). The beta countries table was updated to VES but
* production was not, leaving prod with the deprecated VEF code.
*
* This migration corrects prod to use VES. The filter on both country_code and iso
* is intentional: it makes the migration safe to run on beta (where iso is already
* VES and the WHERE clause simply matches no rows) without clobbering anything.
*
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
export const up = async function (knex) {
await knex('countries').where({ country_code: 'VE', iso: 'VEF' }).update({ iso: 'VES' });
};

/**
* @param { import("knex").Knex } knex
* @returns { Promise<void> }
*/
export const down = async function (knex) {
await knex('countries').where({ country_code: 'VE', iso: 'VES' }).update({ iso: 'VEF' });
};
2 changes: 2 additions & 0 deletions packages/api/src/models/farmModel.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,7 @@ class Farm extends baseModel {
'BDT',
'BBD',
'BYR',
'BYN',
'BZD',
'XOF',
'BMD',
Expand Down Expand Up @@ -229,6 +230,7 @@ class Farm extends baseModel {
'UZS',
'VUV',
'VEF',
'VES',
'VND',
'YER',
'ZMW',
Expand Down
Loading