-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix Tasks/Notes created with null position + set position non-nullabl…
…e + remove sync-metadata health-check
- Loading branch information
Showing
53 changed files
with
489 additions
and
482 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
...erver/src/database/commands/upgrade-version/0-40/0-40-record-position-backfill.command.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
import { InjectRepository } from '@nestjs/typeorm'; | ||
|
||
import { Command } from 'nest-commander'; | ||
import { Repository } from 'typeorm'; | ||
|
||
import { ActiveWorkspacesCommandRunner } from 'src/database/commands/active-workspaces.command'; | ||
import { BaseCommandOptions } from 'src/database/commands/base.command'; | ||
import { RecordPositionBackfillService } from 'src/engine/api/graphql/workspace-query-runner/services/record-position-backfill-service'; | ||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity'; | ||
|
||
@Command({ | ||
name: 'migrate-0.40:backfill-record-position', | ||
description: 'Backfill record position', | ||
}) | ||
export class RecordPositionBackfillCommand extends ActiveWorkspacesCommandRunner { | ||
constructor( | ||
@InjectRepository(Workspace, 'core') | ||
protected readonly workspaceRepository: Repository<Workspace>, | ||
private readonly recordPositionBackfillService: RecordPositionBackfillService, | ||
) { | ||
super(workspaceRepository); | ||
} | ||
|
||
async executeActiveWorkspacesCommand( | ||
_passedParam: string[], | ||
options: BaseCommandOptions, | ||
workspaceIds: string[], | ||
): Promise<void> { | ||
for (const workspaceId of workspaceIds) { | ||
await this.recordPositionBackfillService.backfill( | ||
workspaceId, | ||
options.dryRun ?? false, | ||
); | ||
} | ||
} | ||
} |
46 changes: 46 additions & 0 deletions
46
.../twenty-server/src/database/commands/upgrade-version/0-40/0-40-upgrade-version.command.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
import { InjectRepository } from '@nestjs/typeorm'; | ||
|
||
import { Command } from 'nest-commander'; | ||
import { Repository } from 'typeorm'; | ||
|
||
import { ActiveWorkspacesCommandRunner } from 'src/database/commands/active-workspaces.command'; | ||
import { BaseCommandOptions } from 'src/database/commands/base.command'; | ||
import { RecordPositionBackfillCommand } from 'src/database/commands/upgrade-version/0-40/0-40-record-position-backfill.command'; | ||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity'; | ||
import { SyncWorkspaceMetadataCommand } from 'src/engine/workspace-manager/workspace-sync-metadata/commands/sync-workspace-metadata.command'; | ||
|
||
@Command({ | ||
name: 'upgrade-0.40', | ||
description: 'Upgrade to 0.40', | ||
}) | ||
export class UpgradeTo0_40Command extends ActiveWorkspacesCommandRunner { | ||
constructor( | ||
@InjectRepository(Workspace, 'core') | ||
protected readonly workspaceRepository: Repository<Workspace>, | ||
private readonly recordPositionBackfillCommand: RecordPositionBackfillCommand, | ||
private readonly syncWorkspaceMetadataCommand: SyncWorkspaceMetadataCommand, | ||
) { | ||
super(workspaceRepository); | ||
} | ||
|
||
async executeActiveWorkspacesCommand( | ||
passedParam: string[], | ||
options: BaseCommandOptions, | ||
workspaceIds: string[], | ||
): Promise<void> { | ||
await this.recordPositionBackfillCommand.executeActiveWorkspacesCommand( | ||
passedParam, | ||
options, | ||
workspaceIds, | ||
); | ||
|
||
await this.syncWorkspaceMetadataCommand.executeActiveWorkspacesCommand( | ||
passedParam, | ||
{ | ||
...options, | ||
force: true, | ||
}, | ||
workspaceIds, | ||
); | ||
} | ||
} |
19 changes: 19 additions & 0 deletions
19
...s/twenty-server/src/database/commands/upgrade-version/0-40/0-40-upgrade-version.module.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { Module } from '@nestjs/common'; | ||
import { TypeOrmModule } from '@nestjs/typeorm'; | ||
|
||
import { RecordPositionBackfillCommand } from 'src/database/commands/upgrade-version/0-40/0-40-record-position-backfill.command'; | ||
import { UpgradeTo0_40Command } from 'src/database/commands/upgrade-version/0-40/0-40-upgrade-version.command'; | ||
import { RecordPositionBackfillModule } from 'src/engine/api/graphql/workspace-query-runner/services/record-position-backfill-module'; | ||
import { Workspace } from 'src/engine/core-modules/workspace/workspace.entity'; | ||
import { WorkspaceSyncMetadataCommandsModule } from 'src/engine/workspace-manager/workspace-sync-metadata/commands/workspace-sync-metadata-commands.module'; | ||
|
||
@Module({ | ||
imports: [ | ||
TypeOrmModule.forFeature([Workspace], 'core'), | ||
WorkspaceSyncMetadataCommandsModule, | ||
RecordPositionBackfillModule, | ||
WorkspaceSyncMetadataCommandsModule, | ||
], | ||
providers: [UpgradeTo0_40Command, RecordPositionBackfillCommand], | ||
}) | ||
export class UpgradeTo0_40CommandModule {} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 0 additions & 56 deletions
56
...gine/api/graphql/workspace-query-runner/commands/0-20-record-position-backfill.command.ts
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.