feat: add migration to is_syncing_owner column in accounts table

This commit is contained in:
Ahmed Bouhuolia
2024-07-29 20:01:04 +02:00
parent 894c899847
commit acd3265e35
2 changed files with 16 additions and 4 deletions

View File

@@ -1,7 +1,17 @@
exports.up = function (knex) {
return knex.schema.table('accounts', (table) => {
table.boolean('is_syncing_owner').defaultTo(false).after('is_feeds_active');
});
return knex.schema
.table('accounts', (table) => {
table
.boolean('is_syncing_owner')
.defaultTo(false)
.after('is_feeds_active');
})
.then(() => {
return knex('accounts')
.whereNotNull('plaid_item_id')
.orWhereNotNull('plaid_account_id')
.update('is_syncing_owner', true);
});
};
exports.down = function (knex) {

View File

@@ -94,7 +94,9 @@ export function useDisconnectBankAccount(
apiRequest.post(`/banking/bank_accounts/${bankAccountId}/disconnect`),
{
...options,
onSuccess: () => {},
onSuccess: (res, values) => {
queryClient.invalidateQueries([t.ACCOUNT, values.bankAccountId]);
},
},
);
}