Skip to content

Commit f3ae761

Browse files
committed
[db] 4.4.1: database column
1 parent 4299850 commit f3ae761

File tree

4 files changed

+30
-2
lines changed

4 files changed

+30
-2
lines changed

components/gitpod-db/src/team-db.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,10 @@ export interface TeamDB extends TransactionalDB<TeamDB> {
3232
findTeamsByUser(userId: string): Promise<Team[]>;
3333
findTeamsByUserAsSoleOwner(userId: string): Promise<Team[]>;
3434
createTeam(userId: string, name: string): Promise<Team>;
35-
updateTeam(teamId: string, team: Partial<Pick<Team, "name" | "maintenanceMode">>): Promise<Team>;
35+
updateTeam(
36+
teamId: string,
37+
team: Partial<Pick<Team, "name" | "maintenanceMode" | "maintenanceNotification">>,
38+
): Promise<Team>;
3639
addMemberToTeam(userId: string, teamId: string): Promise<"added" | "already_member">;
3740
setTeamMemberRole(userId: string, teamId: string, role: TeamMemberRole): Promise<void>;
3841
removeMemberFromTeam(userId: string, teamId: string): Promise<void>;

components/gitpod-db/src/typeorm/entity/db-team.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
* See License.AGPL.txt in the project root for license information.
55
*/
66

7-
import { Team } from "@gitpod/gitpod-protocol";
7+
import { MaintenanceNotification, Team } from "@gitpod/gitpod-protocol";
88
import { Entity, Column, PrimaryColumn } from "typeorm";
99
import { TypeORM } from "../typeorm";
1010

@@ -28,4 +28,7 @@ export class DBTeam implements Team {
2828

2929
@Column({ default: false })
3030
maintenanceMode?: boolean;
31+
32+
@Column("json", { nullable: true })
33+
maintenanceNotification?: MaintenanceNotification;
3134
}
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
/**
2+
* Copyright (c) 2023 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+
9+
export class AddMaintenanceNotificationToTeam1715694000000 implements MigrationInterface {
10+
public async up(queryRunner: QueryRunner): Promise<void> {
11+
await queryRunner.query("ALTER TABLE `d_b_team` ADD COLUMN `maintenanceNotification` json NULL");
12+
}
13+
14+
public async down(queryRunner: QueryRunner): Promise<void> {
15+
await queryRunner.query("ALTER TABLE `d_b_team` DROP COLUMN `maintenanceNotification`");
16+
}
17+
}

components/gitpod-protocol/src/teams-projects-protocol.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -218,6 +218,11 @@ export interface Organization {
218218
creationTime: string;
219219
markedDeleted?: boolean;
220220
maintenanceMode?: boolean;
221+
maintenanceNotification?: MaintenanceNotification;
222+
}
223+
export interface MaintenanceNotification {
224+
enabled: boolean;
225+
message?: string;
221226
}
222227

223228
export interface OrganizationSettings {

0 commit comments

Comments
 (0)