3 class AddJoinTableBetweenUsersAndChangesets < ActiveRecord::Migration
5 create_table :changesets_subscribers, id: false do |t|
6 t.column :subscriber_id, :bigint, null: false
7 t.column :changeset_id, :bigint, null: false
10 add_foreign_key :changesets_subscribers, [:subscriber_id], :users, [:id]
11 add_foreign_key :changesets_subscribers, [:changeset_id], :changesets, [:id]
13 add_index :changesets_subscribers, [:subscriber_id, :changeset_id], :unique => true
14 add_index :changesets_subscribers, [:changeset_id]