Wiki

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

Guidelines for good schema design

Created 2 years ago by Steve FriedlTips13 comments – viewed 51,411 times – ( +138 ) – 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 2 years ago by samdarkHow-tos6 comments – viewed 20,618 times – ( +37 ) – 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 57,972 times – ( +27 ) – 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 2 years ago by samdarkTips2 comments – viewed 8,457 times – ( +12 ) – 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

A simple class to use a different db for a module

Created 2 years ago by tydeas_drTips2 comments – viewed 11,579 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 7,766 times – ( +8 ) – version 1.1
This is an incipient implementation of application-driven database with Yii.
tags: database, model

Auto set model fields values

Created about a year ago by vibhaJadwaniTutorials3 comments – viewed 11,922 times – ( +8 ) – version 1.1
This is a tutorial for how to auto set model values without any code.

How to display static pages in Yii with database content?

Created about a year ago by yasenTutorials4 comments – viewed 16,181 times – ( +8 ) – 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:

Multiple Databases and Multiple Domains

Created 3 years ago by got 2 doodleTutorials2 comments – viewed 27,579 times – ( +14 / -2 ) – version 1.1
Add these lines in /config/main.php
tags: database

Multiple Database Connection : Select database based on login user id, Dynamic

Created 8 months ago by Rajith RHow-tos4 comments – viewed 8,549 times – ( +6 )
create a class file under protected\components named RActiveRecord.php