Sha256: f04f6e84ca400facc81896d9006517e404a7d1313d2e8cffb60b0eed8b9bf071

Contents?: true

Size: 399 Bytes

Versions: 6

Compression:

Stored size: 399 Bytes

Contents

class RailsSettingsMigration < ActiveRecord::Migration
  def self.up
    create_table :settings do |t|
      t.string     :var,    :null => false
      t.text       :value
      t.references :target, :null => false, :polymorphic => true
      t.timestamps
    end
    add_index :settings, [ :target_type, :target_id, :var ], :unique => true
  end

  def self.down
    drop_table :settings
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
ledermann-rails-settings-2.3.0 lib/generators/rails_settings/migration/templates/migration.rb
ledermann-rails-settings-2.2.1 lib/generators/rails_settings/migration/templates/migration.rb
ledermann-rails-settings-2.2.0 lib/generators/rails_settings/migration/templates/migration.rb
ledermann-rails-settings-2.1.0 lib/generators/rails_settings/migration/templates/migration.rb
ledermann-rails-settings-2.0.3 lib/generators/rails_settings/migration/templates/migration.rb
ledermann-rails-settings-2.0.2 lib/generators/rails_settings/migration/templates/migration.rb