From a07148277545ad52fa34604afe5c01727b2c799e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dariusz=20Wo=C5=BAniak?= Date: Fri, 27 Sep 2024 18:15:07 +0200 Subject: [PATCH] style: format --- .../optimizely/how-to-remove-obsolete-commerce-data.mdx | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/data/blog/optimizely/how-to-remove-obsolete-commerce-data.mdx b/data/blog/optimizely/how-to-remove-obsolete-commerce-data.mdx index 98871df..9a5e311 100644 --- a/data/blog/optimizely/how-to-remove-obsolete-commerce-data.mdx +++ b/data/blog/optimizely/how-to-remove-obsolete-commerce-data.mdx @@ -9,17 +9,17 @@ summary: By default Optimizely code does not remove properties from the database By default, Optimizely code does not remove properties from the database when you remove them from the code. This article describes how to remove obsolete Commerce data and introduces the Opti.Addons project. -# Introduction +### Introduction When we develop a project, we often add new properties to the classes. However, when we remove them, the properties are not removed from the database. This can lead to a situation where the database contains obsolete data that is no longer used in the code. This article describes how to remove that data. Historically, it was possible in the old Episerver Commerce, but that feature is gone as for now. -# Automatically +### Automatically I just created the [Opti.Addons](https://github.com/Opti-Addons) project which in future will contain small handy tools for Optimizely. The first tool is called [DeleteMissingCommercePropertiesScheduledJob](https://github.com/Opti-Addons/Opti.Addons.DeleteMissingCommercePropertiesScheduledJob) and is basically a scheduled job that removes obsolete properties from the database. In order to use it, just install the NuGet package and see two scheduled jobs: one for the listing of properties that are not in the code and the second one for removing them. -# Manually +### Manually Well, you might want to create a migration step, some initializable code, or any other way to remove the properties. Just re-use (read: copy and paste) the code from the project: [MissingCommercePropertiesService.cs](https://github.com/Opti-Addons/Opti.Addons.DeleteMissingCommercePropertiesScheduledJob/blob/main/MissingCommercePropertiesService.cs).