Skip to content

Commit f5b519d

Browse files
committed
Update d_b_identity
1 parent d19eb52 commit f5b519d

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

components/gitpod-db/src/typeorm/migration/1592203031938-Baseline.ts

+6-2
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,14 @@ export class Baseline1592203031938 implements MigrationInterface {
7979

8080
// probe user
8181
{
82-
const exists = (await queryRunner.query(`SELECT COUNT(1) AS cnt FROM d_b_user WHERE id = 'builtin-user-workspace-probe-0000000'`))[0].cnt == 1;
83-
if (!exists) {
82+
const existsUser = (await queryRunner.query(`SELECT COUNT(1) AS cnt FROM d_b_user WHERE id = 'builtin-user-workspace-probe-0000000'`))[0].cnt == 1;
83+
if (!existsUser) {
8484
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', '')`)
8585
}
86+
const existsIdentity = (await queryRunner.query(`SELECT COUNT(1) AS cnt FROM d_b_identity WHERE userId = 'builtin-user-workspace-probe-0000000'`))[0].cnt == 1;
87+
if (!existsIdentity) {
88+
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')`)
89+
}
8690
}
8791
}
8892

0 commit comments

Comments
 (0)