glitch-soc/db/migrate/20180118192721_create_glitch_notes.rb
David Yip 2ce4af84e9
Put the less-specific column on the left-hand side (#193)
Some database systems can make better use of an index if the index
columns are ordered left-to-right in increasing specificity.  I'm not
sure if Postgres is one of those databases, but it also makes sense to
me to read an index as "ordered by type and then ID".
2018-01-27 01:25:22 -06:00

12 lines
296 B
Ruby

class CreateGlitchNotes < ActiveRecord::Migration[5.1]
def change
create_table :glitch_notes do |t|
t.bigint :target_id, null: false
t.string :target_type, null: false
t.text :note, null: false
t.index [:target_type, :target_id]
t.timestamps
end
end
end