Yii Framework Forum: SQLite missing table!? - Yii Framework Forum

Jump to content

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

SQLite missing table!? Rate Topic: -----

#1 User is offline   imehesz 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 703
  • Joined: 13-June 09
  • Location:Jacksonville, FL

Posted 14 December 2009 - 07:47 PM

Hello,

I recently started playing with the new features of yii (ie: test driven development) and I encountered an interesting issue.

I created a DB and ran the yiic shell on it to create a model. everything seems fine, but when I'm trying to run the automatically generated test, I'll get the following error:

1) testCreate(ProjectTest)
CDbException: CDbCommand failed to execute the SQL statement: CDbCommand failed to prepare the SQL statement: SQLSTATE[HY000]: General error: 1 no such table: sqlite_sequenceUPDATE sqlite_sequence SET seq='0' WHERE name='Project'
/var/www/yii-1.1b.r1504/framework/db/CDbCommand.php:227
/var/www/yii-1.1b.r1504/framework/db/schema/sqlite/CSqliteSchema.php:38
/var/www/yii-1.1b.r1504/framework/test/CDbFixtureManager.php:244
/var/www/yii-1.1b.r1504/framework/test/CDbFixtureManager.php:139
/var/www/yii-1.1b.r1504/framework/test/CDbFixtureManager.php:296
/var/www/yii-1.1b.r1504/framework/test/CDbTestCase.php:116


it looks like the table is not recognized even if it's there. I know this, because when I purposely deleted the table, I'll get a different error message:
1) testCreate(ProjectTest)
CDbException: The table "Project" for active record class "Project" cannot be found in the database.
/var/www/yii-1.1b.r1504/framework/db/ar/CActiveRecord.php:1897
/var/www/yii-1.1b.r1504/framework/db/ar/CActiveRecord.php:328
/var/www/yii-1.1b.r1504/framework/test/CDbFixtureManager.php:294
/var/www/yii-1.1b.r1504/framework/test/CDbTestCase.php:116


have you guys seen this before?

thanks
--iM
It’s done, the great act of creation.
The maker rests. The wheel’s in motion.
-- Imre Madách

check out Yii Theme Factory at http://yii.themefactory.net
0

#2 User is offline   imehesz 

  • Master Member
  • PipPipPipPip
  • Yii
  • Group: Members
  • Posts: 703
  • Joined: 13-June 09
  • Location:Jacksonville, FL

Posted 15 December 2009 - 07:15 PM

View Postimehesz, on 14 December 2009 - 07:47 PM, said:

Hello,

I recently started playing with the new features of yii (ie: test driven development) and I encountered an interesting issue.

I created a DB and ran the yiic shell on it to create a model. everything seems fine, but when I'm trying to run the automatically generated test, I'll get the following error:

1) testCreate(ProjectTest)
CDbException: CDbCommand failed to execute the SQL statement: CDbCommand failed to prepare the SQL statement: SQLSTATE[HY000]: General error: 1 no such table: sqlite_sequenceUPDATE sqlite_sequence SET seq='0' WHERE name='Project'
/var/www/yii-1.1b.r1504/framework/db/CDbCommand.php:227
/var/www/yii-1.1b.r1504/framework/db/schema/sqlite/CSqliteSchema.php:38
/var/www/yii-1.1b.r1504/framework/test/CDbFixtureManager.php:244
/var/www/yii-1.1b.r1504/framework/test/CDbFixtureManager.php:139
/var/www/yii-1.1b.r1504/framework/test/CDbFixtureManager.php:296
/var/www/yii-1.1b.r1504/framework/test/CDbTestCase.php:116


it looks like the table is not recognized even if it's there. I know this, because when I purposely deleted the table, I'll get a different error message:
1) testCreate(ProjectTest)
CDbException: The table "Project" for active record class "Project" cannot be found in the database.
/var/www/yii-1.1b.r1504/framework/db/ar/CActiveRecord.php:1897
/var/www/yii-1.1b.r1504/framework/db/ar/CActiveRecord.php:328
/var/www/yii-1.1b.r1504/framework/test/CDbFixtureManager.php:294
/var/www/yii-1.1b.r1504/framework/test/CDbTestCase.php:116


have you guys seen this before?

thanks
--iM



just another comment: it's working with MySQL!

--iM
It’s done, the great act of creation.
The maker rests. The wheel’s in motion.
-- Imre Madách

check out Yii Theme Factory at http://yii.themefactory.net
0

#3 User is offline   DerekC 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 44
  • Joined: 09-December 09
  • Location:Europe

Posted 16 December 2009 - 04:34 PM

Quote

General error: 1 no such table: sqlite_sequence...


Does the sqlite_sequence table exist?
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