Sha256: 00d81f9540cdf491e770578315eaae7cdc979574a45a5d9d6597e4203aa42f86

Contents?: true

Size: 444 Bytes

Versions: 5

Compression:

Stored size: 444 Bytes

Contents

class CreateSettings < ActiveRecord::Migration<%= migration_version %>
  def self.up
    create_table :settings do |t|
      t.string  :var,        null: false
      t.text    :value,      null: true
      t.integer :thing_id,   null: true
      t.string  :thing_type, null: true, limit: 30
      t.timestamps
    end

    add_index :settings, %i(thing_type thing_id var), unique: true
  end

  def self.down
    drop_table :settings
  end
end

Version data entries

5 entries across 5 versions & 2 rubygems

Version Path
jdx-rails-settings-0.7.4 lib/generators/settings/templates/migration.rb
rails-settings-cached-0.7.2 lib/generators/settings/templates/migration.rb
rails-settings-cached-0.7.1 lib/generators/settings/templates/migration.rb
rails-settings-cached-0.7.0 lib/generators/settings/templates/migration.rb
rails-settings-cached-0.6.6 lib/generators/settings/templates/migration.rb