constraints

How to figure out the Foreign Key Constraints of a MySQL table using Doctrine 1.1?

When two models are related to each other, Doctrine automatically generates foreign key constraints in the MySQL database beautifully. The default behaviour for onDelete and onUpdate RESTRICT, but can also be set to SET NULL or CASCADE. Now, I want to create a migration diff from an existing database compared to a YAML file. To do this,...

Can "auto_increment" on "sub_groups" be enforced at a database level?

In Rails, I have the following class Token < ActiveRecord belongs_to :grid attr_accessible :turn_order end When you insert a new token, turn_order should auto-increment. HOWEVER, it should only auto-increment for tokens belonging to the same grid. So, take 4 tokens for example: Token_1 belongs to Grid_1, turn_order should be 1 up...