Skip to content

Commit

Permalink
Merge remote-tracking branch 'refs/remotes/origin/develop' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
abouolia committed Jun 4, 2024
2 parents a4719fe + fd915b5 commit 84dd0fa
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions packages/server/src/commands/bigcapital.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,10 @@ function getAllSystemTenants(knex) {
return knex('tenants');
}

function getAllInitializedSystemTenants(knex) {
return knex('tenants').whereNotNull('initializedAt');
}

// module.exports = {
// log,
// success,
Expand Down Expand Up @@ -183,7 +187,7 @@ commander
.action(async (cmd) => {
try {
const sysKnex = await initSystemKnex();
const tenants = await getAllSystemTenants(sysKnex);
const tenants = await getAllInitializedSystemTenants(sysKnex);
const tenantsOrgsIds = tenants.map((tenant) => tenant.organizationId);

if (cmd.tenant_id && tenantsOrgsIds.indexOf(cmd.tenant_id) === -1) {
Expand Down Expand Up @@ -220,7 +224,6 @@ commander
const oper = migrateTenant(cmd.tenant_id);
migrateOpers.push(oper);
}

Promise.all(migrateOpers).then(() => {
success('All tenants are migrated.');
});
Expand Down Expand Up @@ -280,4 +283,3 @@ commander
exit(error);
}
});

0 comments on commit 84dd0fa

Please sign in to comment.