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.

029_create_wiki_contents.rb 1.1KB

123456789101112131415161718192021222324252627282930
  1. class CreateWikiContents < ActiveRecord::Migration[4.2]
  2. def self.up
  3. create_table :wiki_contents do |t|
  4. t.column :page_id, :integer, :null => false
  5. t.column :author_id, :integer
  6. t.column :text, :text
  7. t.column :comments, :string, :limit => 255, :default => ""
  8. t.column :updated_on, :datetime, :null => false
  9. t.column :version, :integer, :null => false
  10. end
  11. add_index :wiki_contents, :page_id, :name => :wiki_contents_page_id
  12. create_table :wiki_content_versions do |t|
  13. t.column :wiki_content_id, :integer, :null => false
  14. t.column :page_id, :integer, :null => false
  15. t.column :author_id, :integer
  16. t.column :data, :binary
  17. t.column :compression, :string, :limit => 6, :default => ""
  18. t.column :comments, :string, :limit => 255, :default => ""
  19. t.column :updated_on, :datetime, :null => false
  20. t.column :version, :integer, :null => false
  21. end
  22. add_index :wiki_content_versions, :wiki_content_id, :name => :wiki_content_versions_wcid
  23. end
  24. def self.down
  25. drop_table :wiki_contents
  26. drop_table :wiki_content_versions
  27. end
  28. end