Skip to content

Commit

Permalink
Make it woooooooork
Browse files Browse the repository at this point in the history
  • Loading branch information
filiptronicek committed Jan 7, 2025
1 parent 9b95c5b commit c020e89
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 1 deletion.
11 changes: 10 additions & 1 deletion components/gitpod-db/src/typeorm/entity/db-team-settings.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,13 @@
* See License.AGPL.txt in the project root for license information.
*/

import { OrgMemberRole, OrganizationSettings, RoleRestrictions, TimeoutSettings } from "@gitpod/gitpod-protocol";
import {
OnboardingSettings,
OrgMemberRole,
OrganizationSettings,
RoleRestrictions,
TimeoutSettings,
} from "@gitpod/gitpod-protocol";
import { Entity, Column, PrimaryColumn } from "typeorm";
import { TypeORM } from "../typeorm";

Expand Down Expand Up @@ -42,6 +48,9 @@ export class DBOrgSettings implements OrganizationSettings {
@Column({ type: "int", default: 0 })
maxParallelRunningWorkspaces: number;

@Column("json", { nullable: true })
onboardingSettings?: OnboardingSettings | undefined;

@Column()
deleted: boolean;
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
/**
* Copyright (c) 2025 Gitpod GmbH. All rights reserved.
* Licensed under the GNU Affero General Public License (AGPL).
* See License.AGPL.txt in the project root for license information.
*/

import { MigrationInterface, QueryRunner } from "typeorm";
import { columnExists } from "./helper/helper";

const table = "d_b_org_settings";
const newColumn = "onboardingSettings";

export class AddOrgOnboardingSettings1736261239285 implements MigrationInterface {
public async up(queryRunner: QueryRunner): Promise<void> {
if (!(await columnExists(queryRunner, table, newColumn))) {
await queryRunner.query(`ALTER TABLE ${table} ADD COLUMN ${newColumn} JSON NULL`);
}
}

public async down(queryRunner: QueryRunner): Promise<void> {
if (await columnExists(queryRunner, table, newColumn)) {
await queryRunner.query(`ALTER TABLE ${table} DROP COLUMN ${newColumn}`);
}
}
}
1 change: 1 addition & 0 deletions components/gitpod-db/src/typeorm/team-db-impl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -375,6 +375,7 @@ export class TeamDBImpl extends TransactionalDBImpl<TeamDB> implements TeamDB {
"timeoutSettings",
"roleRestrictions",
"maxParallelRunningWorkspaces",
"onboardingSettings",
],
});
}
Expand Down

0 comments on commit c020e89

Please sign in to comment.