feat(custom-domain): remove domainName + add migration for custom dom… (#9872)
…ain + feature flag Blocked by #9849
This commit is contained in:
@ -45,6 +45,11 @@ export const seedFeatureFlags = async (
|
||||
workspaceId: workspaceId,
|
||||
value: true,
|
||||
},
|
||||
{
|
||||
key: FeatureFlagKey.IsCustomDomainEnabled,
|
||||
workspaceId: workspaceId,
|
||||
value: true,
|
||||
},
|
||||
{
|
||||
key: FeatureFlagKey.IsBillingPlansEnabled,
|
||||
workspaceId: workspaceId,
|
||||
|
||||
@ -18,7 +18,6 @@ export const seedWorkspaces = async (
|
||||
Workspace,
|
||||
| 'id'
|
||||
| 'displayName'
|
||||
| 'domainName'
|
||||
| 'inviteHash'
|
||||
| 'logo'
|
||||
| 'subdomain'
|
||||
@ -28,7 +27,6 @@ export const seedWorkspaces = async (
|
||||
[SEED_APPLE_WORKSPACE_ID]: {
|
||||
id: workspaceId,
|
||||
displayName: 'Apple',
|
||||
domainName: 'apple.dev',
|
||||
subdomain: 'apple',
|
||||
inviteHash: 'apple.dev-invite-hash',
|
||||
logo: 'https://twentyhq.github.io/placeholder-images/workspaces/apple-logo.png',
|
||||
@ -37,7 +35,6 @@ export const seedWorkspaces = async (
|
||||
[SEED_ACME_WORKSPACE_ID]: {
|
||||
id: workspaceId,
|
||||
displayName: 'Acme',
|
||||
domainName: 'acme.dev',
|
||||
subdomain: 'acme',
|
||||
inviteHash: 'acme.dev-invite-hash',
|
||||
logo: 'https://logos-world.net/wp-content/uploads/2022/05/Acme-Logo-700x394.png',
|
||||
@ -51,7 +48,6 @@ export const seedWorkspaces = async (
|
||||
.into(`${schemaName}.${tableName}`, [
|
||||
'id',
|
||||
'displayName',
|
||||
'domainName',
|
||||
'subdomain',
|
||||
'inviteHash',
|
||||
'logo',
|
||||
|
||||
@ -0,0 +1,19 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class RemoveDomainNameFromWorkspace1737996712702
|
||||
implements MigrationInterface
|
||||
{
|
||||
name = 'RemoveDomainNameFromWorkspace1737996712702';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "core"."workspace" DROP COLUMN "domainName"`,
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "core"."workspace" ADD "domainName" character varying`,
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -0,0 +1,23 @@
|
||||
import { MigrationInterface, QueryRunner } from 'typeorm';
|
||||
|
||||
export class AddHostnameToWorkspace1737997028359 implements MigrationInterface {
|
||||
name = 'AddHostnameToWorkspace1737997028359';
|
||||
|
||||
public async up(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "core"."workspace" ADD "hostname" character varying`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "core"."workspace" ADD CONSTRAINT "UQ_e6fa363bdaf45cbf8ce97bcebf0" UNIQUE ("hostname")`,
|
||||
);
|
||||
}
|
||||
|
||||
public async down(queryRunner: QueryRunner): Promise<void> {
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "core"."workspace" DROP CONSTRAINT "UQ_e6fa363bdaf45cbf8ce97bcebf0"`,
|
||||
);
|
||||
await queryRunner.query(
|
||||
`ALTER TABLE "core"."workspace" DROP COLUMN "hostname"`,
|
||||
);
|
||||
}
|
||||
}
|
||||
@ -311,7 +311,6 @@ export class SignInUpService {
|
||||
const workspaceToCreate = this.workspaceRepository.create({
|
||||
subdomain: await this.domainManagerService.generateSubdomain(),
|
||||
displayName: '',
|
||||
domainName: '',
|
||||
inviteHash: v4(),
|
||||
activationStatus: WorkspaceActivationStatus.PENDING_CREATION,
|
||||
logo,
|
||||
|
||||
@ -11,6 +11,7 @@ export enum FeatureFlagKey {
|
||||
IsAdvancedFiltersEnabled = 'IS_ADVANCED_FILTERS_ENABLED',
|
||||
IsCommandMenuV2Enabled = 'IS_COMMAND_MENU_V2_ENABLED',
|
||||
IsJsonFilterEnabled = 'IS_JSON_FILTER_ENABLED',
|
||||
IsCustomDomainEnabled = 'IS_CUSTOM_DOMAIN_ENABLED',
|
||||
IsLocalizationEnabled = 'IS_LOCALIZATION_ENABLED',
|
||||
IsBillingPlansEnabled = 'IS_BILLING_PLANS_ENABLED',
|
||||
IsRichTextV2Enabled = 'IS_RICH_TEXT_V2_ENABLED',
|
||||
|
||||
@ -32,10 +32,6 @@ export class Workspace {
|
||||
@PrimaryGeneratedColumn('uuid')
|
||||
id: string;
|
||||
|
||||
@Field({ nullable: true })
|
||||
@Column({ nullable: true })
|
||||
domainName?: string;
|
||||
|
||||
@Field({ nullable: true })
|
||||
@Column({ nullable: true })
|
||||
displayName?: string;
|
||||
@ -126,6 +122,10 @@ export class Workspace {
|
||||
@Column({ unique: true })
|
||||
subdomain: string;
|
||||
|
||||
@Field({ nullable: true })
|
||||
@Column({ unique: true, nullable: true })
|
||||
hostname?: string;
|
||||
|
||||
@Field()
|
||||
@Column({ default: true })
|
||||
isGoogleAuthEnabled: boolean;
|
||||
|
||||
Reference in New Issue
Block a user