Ruby on Rails | Screencasts | Download | Documentation | Weblog | Community | Source

Ticket #11617 (new defect)

Opened 3 weeks ago

Last modified 2 weeks ago

Different INT types on parent and child tables

Reported by: rubygem Assigned to: core
Priority: normal Milestone: 2.x
Component: ActiveRecord Version: edge
Severity: normal Keywords:
Cc:

Description

I observed this on MySQL and Rails edge. The parent table gets a INT(11) as a primary key and the referencing table that uses the parent's ID as a FOREIGN KEY gets the column as a BIGINT(11).

As a result of this all my ALTER TABLE... ADD CONSTRAINT FOREIGN KEYS break, as column types must be the same on MySQL (InnoDB) storage for foreign keys to work.

Change History

04/29/08 16:37:47 changed by matthuhiggins