File tree Expand file tree Collapse file tree 1 file changed +22
-0
lines changed
components/gitpod-db/src/typeorm/migration Expand file tree Collapse file tree 1 file changed +22
-0
lines changed Original file line number Diff line number Diff line change 1+ /**
2+ * Copyright (c) 2024 Gitpod GmbH. All rights reserved.
3+ * Licensed under the GNU Affero General Public License (AGPL).
4+ * See License.AGPL.txt in the project root for license information.
5+ */
6+
7+ import { MigrationInterface , QueryRunner } from "typeorm" ;
8+ import { BUILTIN_INSTLLATION_ADMIN_USER_ID } from "../../user-db" ;
9+
10+ export class AdminUserAddAdminRole1705591447620 implements MigrationInterface {
11+ public async up ( queryRunner : QueryRunner ) : Promise < void > {
12+ await queryRunner . query (
13+ `UPDATE d_b_user SET rolesOrPermissions = '["admin"]' WHERE id = '${ BUILTIN_INSTLLATION_ADMIN_USER_ID } '` ,
14+ ) ;
15+ }
16+
17+ public async down ( queryRunner : QueryRunner ) : Promise < void > {
18+ await queryRunner . query (
19+ `UPDATE d_b_user SET rolesOrPermissions = '[]' WHERE id = '${ BUILTIN_INSTLLATION_ADMIN_USER_ID } '` ,
20+ ) ;
21+ }
22+ }
You can’t perform that action at this time.
0 commit comments