diff --git a/packages/database/src/migrations/20220829032330-AddConstraintDataServiceConfig-modifies-schema.js b/packages/database/src/migrations/20220829032330-AddConstraintDataServiceConfig-modifies-schema.js index 6bb6c89e6e..dc8c887742 100644 --- a/packages/database/src/migrations/20220829032330-AddConstraintDataServiceConfig-modifies-schema.js +++ b/packages/database/src/migrations/20220829032330-AddConstraintDataServiceConfig-modifies-schema.js @@ -21,7 +21,7 @@ exports.up = async function (db) { // If any data elements or groups have not been updated to use a specific dhis instance, we set them to NOT_SET so we can add the constraint await db.runSql(` UPDATE ${table} SET config = (config || '{"dhisInstanceCode": "NOT_SET"}') - WHERE service_type = 'dhis' AND config->>'dhisInstanceCode'::text = 'null'; + WHERE service_type = 'dhis' AND config->>'dhisInstanceCode'::text is null; `); // Add constraint