alter_table(:subject_term) do
      add_foreign_key([:subject_id], :subject, :key => :id)
      add_foreign_key([:term_id], :term, :key => :id)
      add_index([:subject_id, :term_id], :name => "subject_term_idx")