You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
37 lines
982 B
37 lines
982 B
class ActsAsVersioned < ActiveRecord::Migration
|
|
def self.up
|
|
drop_table :wiki_pages
|
|
drop_table :wiki_versions
|
|
|
|
create_table :wiki_pages, :force => true do |t|
|
|
t.integer :course_id
|
|
t.integer :user_id
|
|
t.integer :version, :null => false
|
|
t.string :description
|
|
t.string :title
|
|
t.text :content, :null => false
|
|
t.timestamps
|
|
end
|
|
|
|
WikiPage.create_versioned_table
|
|
end
|
|
|
|
def self.down
|
|
WikiPage.drop_versioned_table
|
|
create_table "wiki_pages", :force => true do |t|
|
|
t.integer "course_id"
|
|
t.string "title", :null => false
|
|
t.integer "diff_countdown", :default => 0, :null => false
|
|
end
|
|
|
|
create_table "wiki_versions", :force => true do |t|
|
|
t.text "content", :null => false
|
|
t.datetime "created_on", :null => false
|
|
t.integer "user_id"
|
|
t.integer "wiki_page_id"
|
|
t.boolean "root", :default => true, :null => false
|
|
t.text "description"
|
|
end
|
|
end
|
|
end
|