1 class AddJoinTableBetweenUsersAndChangesets < ActiveRecord::Migration[4.2]
3 create_table :changesets_subscribers, :id => false do |t|
4 t.column :subscriber_id, :bigint, :null => false
5 t.column :changeset_id, :bigint, :null => false
8 add_foreign_key :changesets_subscribers, :users, :column => :subscriber_id, :name => "changesets_subscribers_subscriber_id_fkey"
9 add_foreign_key :changesets_subscribers, :changesets, :name => "changesets_subscribers_changeset_id_fkey"
11 add_index :changesets_subscribers, [:subscriber_id, :changeset_id], :unique => true
12 add_index :changesets_subscribers, [:changeset_id]