import { UpdateProductV1 , UpdateProductV2 } from './schema-versions' ; import { Migrates , ToVersion } from '@boostercloud/framework-core' ; import { UpdateProduct } from '../../../commands/update-product' ; @ Migrates ( UpdateProduct ) export class UpdateProductMigration { @ ToVersion ( 2 , { fromSchema : UpdateProductV1 , toSchema : UpdateProductV2 } ) public splitDescriptionFieldIntoShortAndLong ( oldEntity ) { return new UpdateProductV2 ( oldEntity . id , oldEntity . sku , oldEntity . name , oldEntity . description , '' , oldEntity . price , oldEntity . pictures , oldEntity . deleted , oldEntity . reason ) ; } }