Sha256: 8c79598c73a4a711d5f42fba0b8a3adbd89405e2977ca872caed6a8d35fc93df
Contents?: true
Size: 487 Bytes
Versions: 34
Compression:
Stored size: 487 Bytes
Contents
class AddDefaultShardIndex < ActiveRecord::Migration[4.2] def change Switchman::Shard.where(default: nil).update_all(default: false) change_column_default :switchman_shards, :default, false change_column_null :switchman_shards, :default, false options = if connection.adapter_name == 'PostgreSQL' { unique: true, where: "\"default\"" } else {} end add_index :switchman_shards, :default, options end end
Version data entries
34 entries across 34 versions & 1 rubygems