Skip to content

Commit

Permalink
#254 changing migration file that adds user reference to professor
Browse files Browse the repository at this point in the history
  • Loading branch information
Carlos-Eduardo-Cabral-da-Cunha committed Jan 10, 2020
1 parent 0b298c1 commit 30b678b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 6 deletions.
5 changes: 0 additions & 5 deletions db/migrate/20190819200814_add_user_reference_to_professor.rb

This file was deleted.

11 changes: 11 additions & 0 deletions db/migrate/20200110161221_add_user_id_to_professors.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
class AddUserIdToProfessors < ActiveRecord::Migration[5.1]
def self.up
add_column :professors, :user_id, :integer, :references => :users
add_index :professors, :user_id
end

def self.down
remove_index :professors, :user_id
remove_column :professors, :user_id
end
end
2 changes: 1 addition & 1 deletion db/schema.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#
# It's strongly recommended that you check this file into your version control system.

ActiveRecord::Schema.define(version: 20190819200814) do
ActiveRecord::Schema.define(version: 20200110161221) do

create_table "accomplishments", force: :cascade do |t|
t.integer "enrollment_id"
Expand Down

0 comments on commit 30b678b

Please sign in to comment.