课程讨论区逻辑更改
This commit is contained in:
parent
7d3d406c00
commit
8460344043
|
@ -0,0 +1,13 @@
|
|||
class AddBoardsTypeToBoards < ActiveRecord::Migration
|
||||
def change
|
||||
add_column :boards, :course_id, :int
|
||||
|
||||
Board.all.each do |board|
|
||||
project = Project.find_by_id(board.project_id)
|
||||
if project && project.project_type == 1
|
||||
board.course_id = board.project_id
|
||||
board.save
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
|
@ -11,7 +11,7 @@
|
|||
#
|
||||
# It's strongly recommended to check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema.define(:version => 20140530102015) do
|
||||
ActiveRecord::Schema.define(:version => 20140603033360) do
|
||||
|
||||
create_table "activities", :force => true do |t|
|
||||
t.integer "act_id", :null => false
|
||||
|
@ -119,6 +119,7 @@ ActiveRecord::Schema.define(:version => 20140530102015) do
|
|||
t.integer "messages_count", :default => 0, :null => false
|
||||
t.integer "last_message_id"
|
||||
t.integer "parent_id"
|
||||
t.integer "course_id"
|
||||
end
|
||||
|
||||
add_index "boards", ["last_message_id"], :name => "index_boards_on_last_message_id"
|
||||
|
|
Loading…
Reference in New Issue