mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) upgrade typeorm so we can support newer postgres
Summary: upgrade typeorm version, so Grist can run against newer versions of postgres. Dusted off some old benchmarking code to verify that important queries don't get slower. They don't appear to, unlike for some intermediate versions of typeorm I tried in the past. Most of the changes are because `findOne` changed how it interprets its arguments, and the value it returns when nothing is found. For the return value, I stuck with limiting its impact by emulating old behavior (returning undefined rather than null) rather than propagating the change out to parts of the code unrelated to the database. Test Plan: existing tests pass; manual testing with postgres 10 and 14 Reviewers: georgegevoian Reviewed By: georgegevoian Differential Revision: https://phab.getgrist.com/D3613
This commit is contained in:
@@ -599,7 +599,7 @@ export async function updateOrgPlan(orgName: string, productName: string = 'team
|
||||
const dbOrg = await db.findOne(Organization, {where: {name: orgName},
|
||||
relations: ['billingAccount', 'billingAccount.product']});
|
||||
if (!dbOrg) { throw new Error(`cannot find org ${orgName}`); }
|
||||
const product = await db.findOne(Product, {name: productName});
|
||||
const product = await db.findOne(Product, {where: {name: productName}});
|
||||
if (!product) { throw new Error('cannot find product'); }
|
||||
dbOrg.billingAccount.product = product;
|
||||
await dbOrg.billingAccount.save();
|
||||
|
||||
Reference in New Issue
Block a user