Wiki

Articles tagged with "database", sorted by ratingX
Displaying 1-10 of 20 result(s).

Guidelines for good schema design

Created 3 years ago by Steve FriedlTips15 comments – viewed 58,512 times – ( +141 ) – version 1.1
Virtually all Yii applications are built on top of a database, and though Yii is very flexible in how it addresses your DB, some design choices make things more convenient than others.

Single table inheritance

Created 3 years ago by samdarkHow-tos7 comments – viewed 23,523 times – ( +39 ) – version 1.1
Relational databases do not support inheritance so if we need to represent it, we have to somehow store meta info while keeping performance by minimizing JOINs. One way to solve this problem is using single table inheritance. All fields for the whole class tree are stored in a single table. Class name is stored in the type field of the same table.

Multiple-database support in Yii

Created 3 years ago by Steve FriedlHow-tos14 comments – viewed 68,211 times – ( +28 ) – version 1.1
The customary configuration of a Yii application includes just a single database section in the protected/config/main.php file, but it's easy to extend this to support more than one, tying each Model to one of the databases.
tags: Database

Getting nulls from database instead of empty strings

Created 3 years ago by samdarkTips2 comments – viewed 9,202 times – ( +13 ) – version 1.1
To get null from database instead of empty strings you need to set up your DB connection as follows:
tags: database, null

How to display static pages in Yii with database content?

Created 2 years ago by yasenTutorials5 comments – viewed 19,581 times – ( +11 ) – version 1.1
To extend further static pages as shown by Qiang http://www.yiiframework.com/wiki/22/how-to-display-static-pages-in-yii/ here're the steps to take:

How to store array/widget configuration to the database with config validation rules

Created 5 months ago by Kartik VTutorials0 comments – viewed 2,057 times – ( +29 / -4 ) – version 2.0
You may have scenarios, where you want to store a specific array configuration to the database. A classic example could be saving Yii widget configuration to the database and then retrieving it at runtime, with dynamic parameters set. This wiki discusses one of the approaches to do this. Let's consider you have something like the NavBar configuration below to store in the db:

Auto set model fields values

Created 2 years ago by vibhaJadwaniTutorials3 comments – viewed 14,623 times – ( +9 ) – version 1.1
This is a tutorial for how to auto set model values without any code.

A simple class to use a different db for a module

Created 3 years ago by tydeas_drTips2 comments – viewed 12,902 times – ( +9 ) – version 1.1
What would you do if you want/need to have a different than the main database connection in an module's models?

Application-driven database with CDbMigration and an extended CActiveRecord

Created 2 years ago by Tudor IlisoiOthers0 comments – viewed 8,420 times – ( +8 ) – version 1.1
This is an incipient implementation of application-driven database with Yii.
tags: database, model

Multiple Databases and Multiple Domains

Created 4 years ago by got 2 doodleTutorials2 comments – viewed 30,773 times – ( +15 / -2 ) – version 1.1
Add these lines in /config/main.php
tags: database