Wiki

Articles tagged with "database"X
Displaying 11-20 of 21 result(s).

How to catch and log MySQL deadlock errors

Created 3 years ago by sebTips1 comment – viewed 9,854 times – ( +4 ) – version 1.1
This method allows to log InnoDB monitor output when deadlock error occured. This way we will have much more useful data to find and fix deadlock.
tags: database

Update two models with one view

Created 3 years ago by sensorarioTips11 comments – viewed 35,577 times – ( +10 / -2 ) – version 1.1
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

Use application on production/development environment without making changes

Created 3 years ago by ifdatticTips3 comments – viewed 36,852 times – ( +8 / -1 ) – version 1.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.

Application-driven database with CDbMigration and an extended CActiveRecord

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

Guidelines for good schema design

Created 3 years ago by Steve FriedlTips15 comments – viewed 67,972 times – ( +142 ) – 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.

Sub-domains with different databases in Yii!

Created 4 years ago by jwerdHow-tos4 comments – viewed 13,696 times – ( +2 ) – version 1.1
Sub-domains with different databases in Yii!

Single table inheritance

Created 4 years ago by samdarkHow-tos8 comments – viewed 27,207 times – ( +40 ) – 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.

A simple class to use a different db for a module

Created 4 years ago by tydeas_drTips2 comments – viewed 14,587 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?

Getting nulls from database instead of empty strings

Created 4 years ago by samdarkTips2 comments – viewed 10,156 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

Multiple-database support in Yii

Created 4 years ago by Steve FriedlHow-tos17 comments – viewed 81,414 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