N
N
Nubbb2021-08-05 10:14:45
Database design
Nubbb, 2021-08-05 10:14:45

Are there any improvements in my structure and is it correct?

Hello!

The task is to develop the functionality of stores, according to the purchased tariff!

The essence is that - there is a project, shops are registered on it. There is a list of tariffs and each tariff has its own list of functionality that is available to the store that bought this tariff

There is an optoins table - id, name, slug (list of options)
There is a shops table - id, name, slug, logo (list of stores)
There is a table tariffs - id, name, price

A specific list of options is assigned to each tariff

I'm thinking of creating a pivot table for this option_tariff - option_id, tariff_id

how to link a store with a tariff so that it's quick and easy to get a list of options that are available to it?

I was thinking of creating a pivot table with a 1:1 relationship shop_tariff - shop_id, tariff_id, date_from(date of activation of the tariff), date_to(date until which the tariff is active), is_active (a sign of tariff activity)

but I'm not sure about the correct organization of links and how to store the history of all purchased tariffs later

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question