switchman 1.9.5 → 1.9.6
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8f3e448e1f627fcd836971b4e1e866e43082987
|
4
|
+
data.tar.gz: 204b5b664a1349b4e74652e18fbc66281d240f6f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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
|
|
data/lib/switchman/version.rb
CHANGED
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.
|
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-
|
13
|
+
date: 2017-03-23 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: railties
|