switchman 1.9.5 → 1.9.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 76cc38b30914de73cddc2b347abe5e0fdfd1e35f
4
- data.tar.gz: d12887e2755b199c584906a13f51df762ed602d0
3
+ metadata.gz: b8f3e448e1f627fcd836971b4e1e866e43082987
4
+ data.tar.gz: 204b5b664a1349b4e74652e18fbc66281d240f6f
5
5
  SHA512:
6
- metadata.gz: 58f34befaed170ea8a74df108d28bc925edeafe994dbec25d26a93d44ec73f5b5824a8c9ba111963ee7c6d8cfa10051d434d05ff51bb1b517b87ef641f8e844b
7
- data.tar.gz: 7ab150743f0ecc027b4935dc5e2630f2c242a53d191439789399a13433fda2d20f76f3b050f57882a3e57cb241c71659eec8ac3233423085a4b3da636214fffb
6
+ metadata.gz: 2ed76354d01310128a8a0003611810091bfa79b6148f2e7d58e3adef4d810fef6bbe4dc2f819cf2cfe61ac1ea91d86195e30a7da2490b8293afe406356eeaab5
7
+ data.tar.gz: 0f78ee14df104f97acdf4dd01dea9d823f40c6b606d916d893c0273bfec6fd1b76d97014267163f1ec748f33e7e1f1fe522b1148f45d4a4e5df5cda88bbbdddd
@@ -205,6 +205,12 @@ module Switchman
205
205
  ::ActiveRecord::ConnectionAdapters::ForeignKeyDefinition.new(table_name, to_table, options)
206
206
  end
207
207
  end
208
+
209
+ def add_index_options(_table_name, _column_name, _options = {})
210
+ index_name, index_type, index_columns, index_options, algorithm, using = super
211
+ algorithm = nil if DatabaseServer.creating_new_shard && algorithm == "CONCURRENTLY"
212
+ [index_name, index_type, index_columns, index_options, algorithm, using]
213
+ end
208
214
  end
209
215
  end
210
216
  end
@@ -3,6 +3,8 @@ module Switchman
3
3
  attr_accessor :id
4
4
 
5
5
  class << self
6
+ attr_accessor :creating_new_shard
7
+
6
8
  def all
7
9
  database_servers.values
8
10
  end
@@ -173,6 +175,7 @@ module Switchman
173
175
  shard.id = options[:id] if options[:id]
174
176
  end
175
177
  begin
178
+ self.class.creating_new_shard = true
176
179
  if name.nil?
177
180
  base_name = self.config[:database] % self.config
178
181
  base_name = $1 if base_name =~ /(?:.*\/)(.+)_shard_\d+(?:\.sqlite3)?$/
@@ -233,6 +236,8 @@ module Switchman
233
236
  shard.drop_database if shard.name == name rescue nil
234
237
  reset_column_information unless create_schema == false rescue nil
235
238
  raise
239
+ ensure
240
+ self.class.creating_new_shard = false
236
241
  end
237
242
  end
238
243
 
@@ -1,3 +1,3 @@
1
1
  module Switchman
2
- VERSION = "1.9.5"
2
+ VERSION = "1.9.6"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: switchman
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.9.5
4
+ version: 1.9.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cody Cutrer
@@ -10,7 +10,7 @@ authors:
10
10
  autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2017-03-08 00:00:00.000000000 Z
13
+ date: 2017-03-23 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: railties