Migration or BDforge/ GRAILS

Hey, Iam new to Yii, but as far I can see. It is the best replacement for Rails :wink:

Very good work!

The only thing I miss is something like DBforge from Codeignitior or migration from RAILS.

But I would suggest the way groovy/ Grails went. They put migration and the models in one file. And when the model is used it automatically updates or changes the Database. Without running a migration script. This would realy cool ;)

Thank you! We will consider implementation DB migration when we get time.

Another db related idea! After creating a new webapp you could use this yiic command: yiic db IP:PORT:USERNAME:PASSWORD

and yii do the rest, automatic detection of the used DB and entering it in the config file/s. Shouldnt be to hard to autodetect, and cause it is done just once after creating it shouldnt slow down the whole thing ;)

Here is an example how grails models work :wink:

And i will try to explain…

The first should be clear: class is the module name, and automatically the table name.

User user means one to one relation the rest is standard "models" creation like rails for example.

But the interesting part is here:

This is validation and row creation in one "line" this part checks if the caption string is between 1 and 40. And grails creates with this information a string ( char ) row with maximum 40 chars and with NULL: FALSE.

I love grails for this! But grails models dont work with some special kind of relation ships. So i couldn't use it oO