Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
class CreateSongs < ActiveRecord::Migration
def change
create_table :songs do |t|
t.string :title
t.integer :artist_id, limit: 8
t.timestamps
end
add_index :songs, :title
add_foreign_key :songs, :artists
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment