Sha256: 4d91fab996165d547858783f50b0f8679a605b3f9d1a41e69b93abe534aa65e2

Contents?: true

Size: 691 Bytes

Versions: 3

Compression:

Stored size: 691 Bytes

Contents

class CreateRailsAdminSettings < ActiveRecord::Migration
  def change
    create_table :rails_admin_settings do |t|
      t.boolean :enabled, default: true
      t.string :type, null: false, default: 'string'
      t.string :ns, default: 'main'
      t.string :key, null: false
      if Object.const_defined?('Geocoder')
        t.float :latitude
        t.float :longitude
      end
      t.text :raw
      t.string :label
      if defined?(Paperclip)
        t.attachment :file
      elsif defined?(CarrierWave)
        t.string :file
      end
      t.timestamps
    end

    add_index :rails_admin_settings, :key
    add_index :rails_admin_settings, [:ns, :key], unique: true
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
rails_admin_settings-0.9.0.pre.3 lib/generators/rails_admin_settings/templates/migration.rb
rails_admin_settings-0.9.0.pre.2 lib/generators/rails_admin_settings/templates/migration.rb
rails_admin_settings-0.9.0.pre lib/generators/rails_admin_settings/templates/migration.rb