Skip to content

Instantly share code, notes, and snippets.

@delkopiso
Last active December 11, 2017 18:53
Show Gist options
  • Save delkopiso/cc3d8a1c6d4a2f09465783f1a6de250e to your computer and use it in GitHub Desktop.
Save delkopiso/cc3d8a1c6d4a2f09465783f1a6de250e to your computer and use it in GitHub Desktop.
Use and misuse of rails migrations
class CreateFlags < ActiveRecord::Migration[5.1]
def change
create_table :flags do |t|
t.references :comment, foreign_key: true
t.references :user, foreign_key: true
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment