Yii Database Code First Approach

Hi to you all,

Recently I am reading about Code First approach using Entity Framework in ASP.NET MVC framework, which has similar implementaion in Symfony framework using Doctrine, which I like a lot. So my question is how can I implement it with YII,(fixtures, migration etc)?

In brief I would like my workflow to be :

  1. Create php file representing my database tables (aka POCO files)

  2. Create initialization file (eg fixtures for all tables)

  3. Generating my database tables from the above files (which will be recreated each time I start the application for e.g. Unit Testing)

Thanks