diff --git a/db/migrate/20160927043409_create_admin_users_pages_join.rb b/db/migrate/20160927043409_create_admin_users_pages_join.rb index 0a1fb6d..45976ce 100644 --- a/db/migrate/20160927043409_create_admin_users_pages_join.rb +++ b/db/migrate/20160927043409_create_admin_users_pages_join.rb @@ -2,11 +2,9 @@ class CreateAdminUsersPagesJoin < ActiveRecord::Migration[5.0] def up create_table :admin_users_pages, :id => false do |t| # Remove the primary key **Very important - t.integer "admin_user_id" - t.integer "page_id" + t.refereneces :page + t.refereneces :admin_user end - # You can add multiple indexes at the same time - add_index :admin_users_pages, ["admin_user_id", "page_id"] end def down