3 class AddJoinTableBetweenUsersAndDiaryEntries < ActiveRecord::Migration
5 create_table :diary_entry_subscriptions, :id => false do |t|
6 t.column :user_id, :bigint, :null => false
7 t.column :diary_entry_id, :bigint, :null => false
10 add_primary_key :diary_entry_subscriptions, [:user_id, :diary_entry_id]
11 add_index :diary_entry_subscriptions, [:diary_entry_id]
12 add_foreign_key :diary_entry_subscriptions, :diary_entries, :name => "diary_entry_subscriptions_diary_entry_id_fkey"
13 add_foreign_key :diary_entry_subscriptions, :users, :name => "diary_entry_subscriptions_user_id_fkey"
17 drop_table :diary_entry_subscriptions