Sha256: dc751805573f51505fc37fb8dd7c3a7da0fa4a8202e82d128b70bd5425e59af8

Contents?: true

Size: 385 Bytes

Versions: 3

Compression:

Stored size: 385 Bytes

Contents

class RailsSettingsMigration < ActiveRecord::Migration[5.0]
  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 null: true
    end
    add_index :settings, %i[target_type target_id var], unique: true
  end

  def self.down
    drop_table :settings
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
ledermann-rails-settings-2.6.2 lib/generators/rails_settings/migration/templates/migration.rb
ledermann-rails-settings-2.6.1 lib/generators/rails_settings/migration/templates/migration.rb
ledermann-rails-settings-2.6.0 lib/generators/rails_settings/migration/templates/migration.rb