Add logs and fix timestamps in migrate domain command (#6468)
This commit is contained in:
@ -130,12 +130,17 @@ export class MigrateDomainNameFromTextToLinksCommand extends CommandRunner {
|
|||||||
await workspaceQueryRunner.connect();
|
await workspaceQueryRunner.connect();
|
||||||
|
|
||||||
const fieldName = domainNameField.name;
|
const fieldName = domainNameField.name;
|
||||||
const { id: _id, ...domainNameFieldWithoutId } = domainNameField;
|
const {
|
||||||
|
id: _id,
|
||||||
|
createdAt: _createdAt,
|
||||||
|
updatedAt: _updatedAt,
|
||||||
|
...domainNameFieldWithoutIdAndTimestamps
|
||||||
|
} = domainNameField;
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const tmpNewDomainLinksField =
|
const tmpNewDomainLinksField =
|
||||||
await this.fieldMetadataService.createOne({
|
await this.fieldMetadataService.createOne({
|
||||||
...domainNameFieldWithoutId,
|
...domainNameFieldWithoutIdAndTimestamps,
|
||||||
type: FieldMetadataType.LINKS,
|
type: FieldMetadataType.LINKS,
|
||||||
name: `${fieldName}Tmp`,
|
name: `${fieldName}Tmp`,
|
||||||
defaultValue: {
|
defaultValue: {
|
||||||
@ -207,6 +212,7 @@ export class MigrateDomainNameFromTextToLinksCommand extends CommandRunner {
|
|||||||
|
|
||||||
this.logger.log(`Migration of domainName done!`);
|
this.logger.log(`Migration of domainName done!`);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
|
this.logger.log(`Error: ${error.message}`);
|
||||||
this.logger.log(
|
this.logger.log(
|
||||||
`Failed to migrate domainName ${domainNameField.id}, rolling back.`,
|
`Failed to migrate domainName ${domainNameField.id}, rolling back.`,
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user