Skip to content

Commit

Permalink
refactor(database): remove defaultWorkspaceId and fix imports
Browse files Browse the repository at this point in the history
Removed the defaultWorkspaceId column and its associated constraints from database migrations. Additionally, added an import in workspace.entity.ts to address circular dependency issues.
  • Loading branch information
AMoreaux committed Dec 20, 2024
1 parent 97fd185 commit bef5132
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,15 +12,9 @@ export class RemoveDefaultWorkspaceId1734544295083
await queryRunner.query(
`ALTER TABLE "core"."user" DROP COLUMN "defaultWorkspaceId"`,
);
await queryRunner.query(
`ALTER TABLE "core"."workspace" DROP CONSTRAINT "UQ_e6fa363bdaf45cbf8ce97bcebf0"`,
);
}

public async down(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE "core"."workspace" ADD CONSTRAINT "UQ_e6fa363bdaf45cbf8ce97bcebf0" UNIQUE ("domainName")`,
);
await queryRunner.query(
`ALTER TABLE "core"."user" ADD "defaultWorkspaceId" uuid NOT NULL`,
);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@ import { KeyValuePair } from 'src/engine/core-modules/key-value-pair/key-value-p
import { PostgresCredentials } from 'src/engine/core-modules/postgres-credentials/postgres-credentials.entity';
import { WorkspaceSSOIdentityProvider } from 'src/engine/core-modules/sso/workspace-sso-identity-provider.entity';
import { UserWorkspace } from 'src/engine/core-modules/user-workspace/user-workspace.entity';
// This line is necessary to avoid a circular dependency issue. Need to deep dive
// eslint-disable-next-line
import { User } from 'src/engine/core-modules/user/user.entity';

export enum WorkspaceActivationStatus {
ONGOING_CREATION = 'ONGOING_CREATION',
Expand Down

0 comments on commit bef5132

Please sign in to comment.