Database Confusion

Hello,

I’m on the database phase now. I want to create a database from scratch. Any tips on how to make it? I have seen a schema.mysql.sql in a test file and I have seen this .db file. How can I make a .db file?

I would really like to apply these, http://www.yiiframework.com/doc/guide/1.1/en/quickstart.first-app

but I want to start from scratch, not from some scratch db, is there anyway I could do this???

Chabx

@Chabx, you’re really asking a SQLite question which is really independent of Yii. Here is a link to the quickstart page for SQLite It explains how to create a .db file and other useful tips for getting started.

Hi, I recomend you two points regarding database creation to use with Yii:

  1. Design your tables following this guidelines: http://www.yiiframework.com/wiki/227/guidelines-for-good-schema-design. If you do this, the Yii code generators (yiic and Gii) will be able to automatically generate more and better code from your tables.

  2. Sqlite is good for test a web application, to make an embedded application or a monouser application (like mobile applications). But for web applications you will need another database engine like MySQL, PostgreSQL, Microsoft SQL Server, etc. I recommend you that create your tables using the "database migration" Yii feature (http://www.yiiframework.com/doc/guide/1.1/en/database.migration). In this way, you can create your tables through Yii code and can use it with different databases engines. Furthermore, it will simplifies a lot the process of change the structure of your tables in the future.

Cheers,

Leandro