O
O
Orc6662016-10-30 17:44:59
Yii
Orc666, 2016-10-30 17:44:59

Should I paste application settings in migrations?

Hello!
The database has a table app_settings for storing application settings with the following structure:
id - record id,
key - setting name,
value - setting value,
description - description.
Example:
1, admin_email, [email protected], Administrator email
2, site_name, Test, Site name
......
Is it worth inserting settings names (admin_email, site_name ...) into the table in migrations, or better not costs? How good is this practice?
As far as I know, migrations are used only to change the structure of tables; inserting data seems to be not allowed. But in this case, the performance of the application depends on the data.

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dmitriy, 2016-10-30
@dmitriylanets

Data is inserted during migrations, but static data that is not changed by system users, for example, a list of currencies, cities, countries, etc., etc.
But, accordingly, the data that is changed by users, and the settings you listed relate to them, should not be touched, they may need to be set at the time of system installation

D
Dmitry, 2016-10-30
@slo_nik

Good evening.
Where did you get this nonsense from?
Moreover, the performance of the application depends on it.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question