Blog Tutorial: Setting Up The Db

Hello,

I follow the blog totorial on this site to start with yii. Im now in the section where i should setting up the db:

Blog Tutorial. But there occurs an error that the databases already exists. This is what i do:

I copy the "blog.db" data into the folder "…blog/proteced/data" and run "sqlite3.exe". At the first time i run it there comes a message that the tbl_user already exists. Now i run it again and there comes a message that five tables already exists.

That are my cmd lines:

http://www.yiiMicrosoft Windows [Version 6.1.7601]

Copyright © 2009 Microsoft Corporation. Alle Rechte vorbehalten.

C:\Users\m>cd C:\xampp\htdocs\yii\demos\blog\protected\data

C:\xampp\htdocs\yii\demos\blog\protected\data>sqlite3.exe blog.db < schema.sqlit

e.sql

Error: near line 1: table tbl_lookup already exists

Error: near line 10: table tbl_user already exists

Error: near line 19: table tbl_post already exists

Error: near line 33: table tbl_comment already exists

Error: near line 47: table tbl_tag already exists

C:\xampp\htdocs\yii\demos\blog\protected\data>

What do i wrong?

Maybe it’s not clear at first sight but the documentation say

[color=#222222][font=Arial, sans-serif][size=4][/size][/font][/color]

[color=#222222][font=Arial, sans-serif][size=4][/size][/font][/color]

So if you copy it, that’s all you don’t need to “generate it”.

Thank you for you reply. I edited the "main.php" now as follow:


		'db'=>array(

			'connectionString' => 'sqlite:/localhost/blog/protected/data/blog.db',

                        'tablePrefix'=>'tbl_',

		),

But if i use the Model Generator of the Gii Tool, im only able to create a Model for “tbl_user”, not for the other tables like “Post”. If i try to create a model for post, the tool shows me an error that the table not exists. Seems like the db hasen’t be created. What did i wrong?

If its change something: i try to run the tutorial with xampp on my local computer and not at a webserver.

Did you COPY the blog.db to the data dir as indicated by a previous poster?

Also, in GII I believe you can generate all models at one time by putting * in the tableName field. try that, and preview. does the preview show only tbl_user, or more?