Get Indexes From Tableschema

yo everybody,

is there a way to retrieve information about indexes in an existing table. as far as i have seen in CDbTableSchema and CDbColumnSchema you can only get information about the primary and foreign key but not about which column is an index.

Hello DamirDiz,

at the Model, you can touch [font="Courier New"]::getTableSchema()[/font]:


	public function getTableSchema()

	{

		$table = parent::getTableSchema();


		print_r( $table ); // will drop table index schema


		// You may force a FK key which is not a PK from an another model

		// $table->columns[ <attr_on_this_model> ]->isForeignKey = True;

		// $table->foreignKeys[ <attr_on_this_model> ] = array( <another_model_name>, <attr_on_other_model> );


		return $table;  // Don't forget it!

	}

Hope it helps!

cbi