Skip to content

Commit

Permalink
Update d_b_identity
Browse files Browse the repository at this point in the history
  • Loading branch information
jeanp413 committed Jan 12, 2022
1 parent 6ac7060 commit bc48b5d
Showing 1 changed file with 6 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -79,10 +79,14 @@ export class Baseline1592203031938 implements MigrationInterface {

// probe user
{
const exists = (await queryRunner.query(`SELECT COUNT(1) AS cnt FROM d_b_user WHERE id = 'builtin-user-workspace-probe-0000000'`))[0].cnt == 1;
if (!exists) {
const existsUser = (await queryRunner.query(`SELECT COUNT(1) AS cnt FROM d_b_user WHERE id = 'builtin-user-workspace-probe-0000000'`))[0].cnt == 1;
if (!existsUser) {
await queryRunner.query(`INSERT IGNORE INTO d_b_user (id, creationDate, avatarUrl, name, fullName) VALUES ('${BUILTIN_WORKSPACE_PROBE_USER_ID}', '${new Date().toISOString()}', '', 'builtin-workspace-prober', '')`)
}
const existsIdentity = (await queryRunner.query(`SELECT COUNT(1) AS cnt FROM d_b_identity WHERE userId = 'builtin-user-workspace-probe-0000000'`))[0].cnt == 1;
if (!existsIdentity) {
await queryRunner.query(`INSERT IGNORE INTO d_b_identity (authProviderId, authId, authName, userId) VALUES ('Public-GitHub', '12345678', 'builtin-workspace-prober', 'builtin-user-workspace-probe-0000000')`)
}
}
}

Expand Down

0 comments on commit bc48b5d

Please sign in to comment.