Sha256: a7d410d6a1cd6c3bdff03619eaa582b241723589e5baf690b11f4ed81a421aaa
Contents?: true
Size: 518 Bytes
Versions: 6
Compression:
Stored size: 518 Bytes
Contents
# frozen_string_literal: true 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
6 entries across 6 versions & 1 rubygems