SQL column type mapping errors in CPgsqlSchema


I am excited to start using Yii’s database migration tool. I use PostgreSQL and found some errors in the mapping of abstract column types to physical column types. Most notablely, the abstract ‘datetime’ type mapped to the pgsql ‘time’ type. The pgsql ‘time’ type is not inteaded for storing dates and times. I corrected the mapping to the pgsql ‘timestamp’ type.

I also made two other changes. I removed the unnecessary ‘NOT NULL’ string from the abstract ‘pk’ type, since ‘PRIMARY KEY’ implies ‘NOT NULL.’ Reference Source Lastly, I dropped the arbitrary length specifier from the abstract ‘string’ type, since there are no advantages to specifying the length in a PostgreSQL database. Reference Source

I have attached a diff of my changes to the CPgsqlSchema.php file for your review. I hope you will approve of my changes and integrate them into a future release. I look forward to helping improve Yii.



Thanks. Can you double this in an issue ticket http://code.google.com/p/yii/issues/entry so we’ll review it for sure?