Sha256: 291a9ea5ddd0a49fbc17fef717881e4d34603d9d6eb3ebd41c45519acd4d140e
Contents?: true
Size: 520 Bytes
Versions: 16
Compression:
Stored size: 520 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
16 entries across 16 versions & 1 rubygems