What are the Slack Archives?
Itβs a history of our time together in the Slack Community! Thereβs a ton of knowledge in here, so feel free to search through the archives for a possible answer to your question.
Because this space is not active, you wonβt be able to create a new post or comment here. If you have a question or want to start a discussion about something, head over to our categories and pick one to post in! You can always refer back to a post from Slack Archives if needed; just copy the link to use it as a reference..
Good Morning Community, we are currently starting to work with the Product Measurement Unit feature.
Good Morning Community,
we are currently starting to work with the Product Measurement Unit feature.
Specifically, we use these file: product_measurement_sales_unit.csv
Question: How can I delete data once it has been imported? π€
Comments
-
Hi Frederik!
If the question is about local or some staging env, you will need to change this data with the data you need and re-create DB.
Otherwise only manually I believe.0 -
Hey Valerii,
this affects our live environment. it happens that some data are not correct, so they have to be deleted. What do you mean by manual?DELETE FROM spy_product_measurement_sales_unit WHERE id_product_measurement_sales_unit = xxx
REALLY??? π²0 -
Depends on the import process of the project then. Do you use default importers or adjusted\own?
0 -
We use the spryker default importer
0 -
Sorry, I may be wrong as I haven't worked with the feature closely myself but according to https://documentation.spryker.com/docs/measurement-units-feature-overview there are some constraints:
Current constraints In the Spryker Commerce OS you cannot define measurement units for products. Currently, they are imported into the database manually.
I understand it (and couldn't find in Zed) like there is no UI for managing this feature in Zed. So as soon as you imported it, you will need to remove it manually from the DB.
0 -
@UP5GJTY58 I believe you could shed the light here.
0 -
okay, suppose I really delete data from the live database, what about the KV storage?
0 -
Let's wait for a feedback from Karoly, I'm not sure.
Maybe it's possible to import the empty\changed file and it will trigger all the listeners automatically.0 -
Yes, the backoffice (management) part of the features is not scheduled currently. This means that only manual removal is possible at the moment and the Storage update also needs to be triggered βmanuallyβ.
0 -
IMO it makes sense to test the case with import empty\changed file. If it removes\updates everything correctly everywhere: in DB and Redis\ES.
0 -
Yes,
1] if you delete sales MU entities
2] and you trigger aPRODUCT_CONCRETE_MEASUREMENT_UNIT_PUBLISH
event for the corresponding $productId, the storage will recalculate itself.
This means, that as @valerii.trots pointed out, if you just update 1 (correct) sales unit for the corresponding product via data import, it will also remove the deleted sales units for the product from Storage.
0 -
Maybe i am wrong, but deleting sql data from different tables in a productive database doesn't sound like enterprise ecommerce software to me π€
0 -
But editing\removing via import of that file should do the trick. Import will trigger correct listeners and everything will just work. Please try it.
I could try it myself and provide a step-by-step how to but I have tickets to process in my queue unfortunately.0 -
@UL6Q0LYJ3 Iβm NOT aware in what state your product is. Ofc if we are talking about a production environement recurring action, then this is NOT the recomended way.
0 -
@valerii.trots overwriting via import works if the key is identical
@UP5GJTY58 our data are generally in good condition. With 2.7 million products, it happens sometimes that errors (such as incorrect units that have to be deleted) are included.0 -
A possible solution is to introduce
is_active
flag for sales units.
This would mean to have
β’ the publishing adjusted, so only active sales units are published to Redis/ES
β’ business checks also need to be adjusted so only active sales units are considered
β’ data importer can have an is_active column which can control this behaviour0 -
That sounds like a good solution. In addition, the ZED GUI should be expanded to manage the units.
0 -
Here @jeremy.fourna or @UT9PVABFB could shed the light on the ETA but they are both on vacation.
0 -
But as Karoly already said:
Yes, the backoffice (management) part of the features is not scheduled currently.
0 -
Hello @UL6Q0LYJ3 @valerii.trots Indeed. The backoffice management for Measurment units are not in the roadmap for 2021. It is in the long term roadmap, but there is no ETA that can be shared yet.
0
Categories
- All Categories
- 42 Getting Started & Guidelines
- 7 Getting Started in the Community
- 8 Additional Resources
- 7 Community Ideas and Feedback
- 76 Spryker News
- 929 Developer Corner
- 787 Spryker Development
- 89 Spryker Dev Environment
- 362 Spryker Releases
- 3 Oryx frontend framework
- 35 Propel ORM
- 68 Community Projects
- 3 Community Ideation Board
- 30 Hackathon
- 3 PHP Bridge
- 6 Gacela Project
- 26 Job Opportunities
- 3.2K π Slack Archives
- 116 Academy
- 5 Business Users
- 370 Docker
- 551 Slack General
- 2K Help
- 75 Knowledge Sharing
- 6 Random Stuff
- 4 Code Testing
- 32 Product & Business Questions
- 70 Spryker Safari Questions
- 50 Random