summaryrefslogtreecommitdiffstats
path: root/db/migrate/017_create_settings.rb
blob: 4c18329cc9dd090abe95ae15528b726d0cd0ce59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
class CreateSettings < ActiveRecord::Migration[4.2]
  def self.up
    create_table :settings, :force => true do |t|
      t.column "name", :string, :limit => 30, :default => "", :null => false
      t.column "value", :text
    end

    # Persist text_formatting default setting for new installations
    setting = Setting.new(:name => "text_formatting", :value => Setting.text_formatting)
    setting.save!
  end

  def self.down
    drop_table :settings
  end
end