20161017200008_create_article_cats.rb 519 B

12345678910111213141516171819
  1. # encoding:utf-8
  2. class CreateArticleCats < ActiveRecord::Migration
  3. def self.up
  4. create_table :article_cats do |t|
  5. t.column :name, :string, :null => false, :limit => 100
  6. t.column :position, :integer
  7. t.column :ancestry, :string, :limit => 100
  8. t.column :state, :boolean, :default => false
  9. end
  10. add_index :article_cats, :position
  11. add_index :article_cats, :ancestry
  12. add_index :article_cats, :name
  13. end
  14. def self.down
  15. drop_table :article_cats
  16. end
  17. end