Displaying 1 result from an estimated 1 matches for "artist_types".
2006 Jun 21
1
Migration with foreign key won''t work
...reated the following migration file:
class AddArtistsTable < ActiveRecord::Migration
def self.up
create_table :artists, :force => true do |t|
t.column :name, :string, :limit => 100
t.column :artist_type_id, :integer
t.column :about, :text
end
create_table :artist_types, :force => true do |t|
t.column :artist_type, :string, :limit => 20
t.column :description, :string, :limit => 20
end
# Foreign Keys
add_foreign_key_constraint :artists, :artist_type_id, :artist_types,
:artist_type, :on_update => :cascade, :on_delete => :rest...