Sha256: 3b83730124830dee94efd486ba3a57c14ce25858a1d74ef70e7444db20ad73b1
Contents?: true
Size: 618 Bytes
Versions: 9
Compression:
Stored size: 618 Bytes
Contents
class CreateEasySettings < ActiveRecord::Migration[4.2] 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
9 entries across 9 versions & 1 rubygems