Wiki

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

Guidelines for good schema design

Created about a year ago by Steve FriedlTips13 comments – viewed 36,711 times – ( +127 )
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 14,208 times – ( +31 )
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 2 years ago by Steve FriedlHow-tos8 comments – viewed 37,719 times – ( +21 )
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 6,819 times – ( +12 )
To get null from database instead of empty strings you need to set up your DB connection as follows:
tags: database, null

Application-driven database with CDbMigration and an extended CActiveRecord

Created about a year ago by Tudor IlisoiOthers0 comments – viewed 6,002 times – ( +8 )
This is an incipient implementation of application-driven database with Yii.
tags: database, model

A simple class to use a different db for a module

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

Auto set model fields values

Created 11 months ago by vibhaJadwaniTutorials3 comments – viewed 7,701 times – ( +7 )
This is a tutorial for how to auto set model values without any code.

Multiple Databases and Multiple Domains

Created 2 years ago by got 2 doodleTutorials2 comments – viewed 21,313 times – ( +12 / -2 )
Add these lines in /config/main.php
tags: database

Use application on production/development environment without making changes

Created about a year ago by ifdatticTips2 comments – viewed 16,929 times – ( +8 / -1 )
I like programing on my localhost, however it really bugged me to make changes to index.php & config files on my production server. After combining all available wiki articles on this topic and some trial and error this is what I use for my applications so I could just upload it to production server and it will work without any changes.

Update two models with one view

Created about a year ago by sensorarioTips10 comments – viewed 19,388 times – ( +10 / -2 )
Suppose to have two models: Users and Emails. You do not want to store email in a Users model. And User can have 0 or many emails. This is the form generated to create a new user (just username).
tags: database, model, view, form