Sha256: 3fa789dae2be3c405c34f460dd4a09628d005dbbe2e3dcc98a000dea46152a35
Contents?: true
Size: 613 Bytes
Versions: 49
Compression:
Stored size: 613 Bytes
Contents
class CreateEasySettings < ActiveRecord::Migration def up if table_exists?(:easy_settings) add_column(:easy_settings, :type, :string, null: true) unless column_exists?(:easy_settings, :type) else create_table :easy_settings do |t| t.string :type t.string :name t.text :value t.references :project, index: true, foreign_key: true end end unless index_exists?(:easy_settings, [:name, :project_id], unique: true) add_index :easy_settings, [:name, :project_id], unique: true end end def down drop_table :easy_settings end end
Version data entries
49 entries across 49 versions & 1 rubygems