G
G
gpm73152019-12-02 15:12:08
Database design
gpm7315, 2019-12-02 15:12:08

Is the order table structure of an online store correct?

Hello! Looking at the source codes of the CMS of online stores, all are built on the principle that the data from the user's basket table is duplicated in the corresponding order when placing it. In my understanding, it’s more correct to simply add a foreign key to the cart in the order. Or is it bad practice, what do you think?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Araik, 2019-12-02
@NinjaNickName

  • Why do we need a cart table? What CMS has this? oo
  • After placing an order, the cart is cleared, what will the order refer to? Or is it planned to store the history of the basket? And what's the point in that?

V
Vladimir Korotenko, 2019-12-07
@firedragon

This practice is aimed at avoiding mistakes.
If you paid attention, then the price at the time of sale and the discounts applied to the product and bonus data are fixed there, and in many cases you cannot even edit it from the interface.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question