0

In the Yii MVC,

I've added a column to my database in my model using:

$success = Yii::app()->ft_website_prod->createCommand()->addColumn('ft_website.users', 'columnname', 'varchar(64)');

I now need to know how to get this to execute using the controller. I'm new to Yii so even though i've read as much of the Docs as possible, I still can't figure this out.

tereško
  • 58,060
  • 25
  • 98
  • 150
Newtt
  • 6,050
  • 13
  • 68
  • 106

1 Answers1

0

New column could be added to the table as shown

Yii::app()->db->schema->addColumn( 'table_name', 'column_name', 'column type ' );

And droping column as shown

Yii::app()->db->schema->dropColumn( 'tables_name', 'column_name' );
Ninad
  • 1,871
  • 3
  • 15
  • 23