K
K
Koal Koalich2017-10-23 07:21:15
Yii
Koal Koalich, 2017-10-23 07:21:15

How to prepare DB tables for Yii?

Do I understand correctly that I first need to design and create my database tables in phpmyadmin, for example, and then based on them I create controllers and so on from Yii itself?
ps I'm still learning

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Decadal, 2017-10-23
@tmman

There are two different approaches: Database-first and Code-first. Yii insists on a Database-first approach, which you get roughly right. It is advisable to start designing a database not with phpmyadmin, but with a visual representation of the schema (although phpmyadmin also has a schema designer, it is not very convenient to get started).
In the tool that I indicated, you can then generate code and push it into migrations, then carry out these migrations, and then work with Gii

V
Vladimir Borutkin, 2017-10-23
@Atanvar

Design on a piece of paper, create a migration with a database structure, migrate (a database will be created), and then everything else.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question