20120101000060_create_setting.rb 862 B

12345678910111213141516171819202122
  1. class CreateSetting < ActiveRecord::Migration
  2. def up
  3. create_table :settings do |t|
  4. t.column :title, :string, :limit => 200, :null => false
  5. t.column :name, :string, :limit => 200, :null => false
  6. t.column :area, :string, :limit => 100, :null => false
  7. t.column :description, :string, :limit => 2000, :null => false
  8. t.column :options, :string, :limit => 2000, :null => true
  9. t.column :state, :string, :limit => 2000, :null => true
  10. t.column :state_initial, :string, :limit => 2000, :null => true
  11. t.column :frontend, :boolean, :null => false
  12. t.timestamps
  13. end
  14. add_index :settings, [:name], :unique => true
  15. add_index :settings, [:area]
  16. add_index :settings, [:frontend]
  17. end
  18. def down
  19. drop_table :settings
  20. end
  21. end