开发者

Migrations. How to describe current database schema?

Question about migrations, announced at one of the latest releases(1.1.6, am I right?)

So, i have a site working with yii 1.1.5 and i want use migrations now, cause site progressing every day. Wha开发者_开发百科t is the best way to describe first migration, which include all my current database schema?


when you say describe first migration do you mean the class and file name?

yiic migrate create init_db_schema

EDIT In which case I don't believe the migration tool can reverse engineer an existing db and create the migration for you. So, you'll probably have to manually do it. You could use PHPMyAdmin, MySQL Browser/Workbench to generate the CREATE commands for you and inside your migration script, create the command e.g.

$cmd = $this->getDbConnection()->createCommand($sql);
$cmd->execute();
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜