Yii Framework Forum: Cdbexception: Moved From Localhost (Mac, Sqlite) To Shared Host (Linux, Postgres) - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Cdbexception: Moved From Localhost (Mac, Sqlite) To Shared Host (Linux, Postgres) Rate Topic: -----

#1 User is offline   turgs 

  • Newbie
  • Yii
  • Group: Members
  • Posts: 7
  • Joined: 05-July 12

Posted 08 February 2013 - 06:29 AM

I've just moved my site from developing on my mac with sqlite to putting it on a shared host running linux with postgres.

The static pages display fine, but as soon as I display anything dynamic, I get a CDbException:

CDbCommand failed to execute the SQL statement: SQLSTATE[42P01]: Undefined table: 7 ERROR: missing FROM-clause entry for table "assetchanges"

I seems to be either due to case sensitivity or quotes around the table/column aliases.

How can I start to fix these issues? Where do I look?
Why would the alias be "assetchanges" when in the model it's set to "assetChanges", etc?

In this example, I'm trying to display actionHome within the Portfolio controller, which looks like this:

public function actionHome($id)
{
  Yii::app()->params['portfolio_id'] = $id;

  # Get data for this view
  # =======================

  $criteria = array(
	'assets'=>array('together'=>true),
	'assets.assetType'=>array('together'=>true),
	'assets.assetChanges'=>array('together'=>true),
  );

  $portfolio = Portfolio::model()->thisUsers()->with($criteria)->findByPk($id);
  $this->render('home', array('portfolio' => $portfolio));
}

0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users