mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
refactor: Upgrade typeorm to 0.3.x (#5151)
This commit is contained in:
committed by
GitHub
parent
6608e69457
commit
0a5ab560b1
@@ -9,23 +9,23 @@ export class Reset extends BaseCommand {
|
||||
async run(): Promise<void> {
|
||||
const owner = await this.getInstanceOwner();
|
||||
|
||||
const ownerWorkflowRole = await Db.collections.Role.findOneOrFail({
|
||||
const ownerWorkflowRole = await Db.collections.Role.findOneByOrFail({
|
||||
name: 'owner',
|
||||
scope: 'workflow',
|
||||
});
|
||||
|
||||
const ownerCredentialRole = await Db.collections.Role.findOneOrFail({
|
||||
const ownerCredentialRole = await Db.collections.Role.findOneByOrFail({
|
||||
name: 'owner',
|
||||
scope: 'credential',
|
||||
});
|
||||
|
||||
await Db.collections.SharedWorkflow.update(
|
||||
{ user: { id: Not(owner.id) }, role: ownerWorkflowRole },
|
||||
{ userId: Not(owner.id), roleId: ownerWorkflowRole.id },
|
||||
{ user: owner },
|
||||
);
|
||||
|
||||
await Db.collections.SharedCredentials.update(
|
||||
{ user: { id: Not(owner.id) }, role: ownerCredentialRole },
|
||||
{ userId: Not(owner.id), roleId: ownerCredentialRole.id },
|
||||
{ user: owner },
|
||||
);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user