Answer the question
In order to leave comments, you need to log in
What database structure to choose for two identical sites in Yii2?
It is necessary to update two logically identical sites written on the knee in 2009.
Both sites are owned by the same owner. He wished that the design and logic were again the same in order to keep the "similarity" of the sites.
One template was selected for development Yii2-advanced
. Sites are built on a modular system, all modules (controllers, models, views, traits, interfaces, widgets and behaviors) are stored in common
, widgets, helpers, etc. are also located there. In the site location folders, only folders config
and web
. Only small differences between projects remained in the config folder - id and project names, admin emails, etc.
At this stage, almost all the logic of work has been created, tables in the form are used in queries {{%news}}
, the database is specified in common/config/main-local.php
.
Now the main question:
How to deal with the database?
common/config/main-local.php
, and specify the table prefixes in the configs of each site? And the second question: how to deal with console
and migrations
? After all, as far as I understand, migrations do not use prefixes?
Answer the question
In order to leave comments, you need to log in
After some discussion, the first option was chosen as the optimal solution.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question