switchman 1.10.2 → 1.10.3
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 +4 -4
- data/lib/switchman/active_record/postgresql_adapter.rb +22 -0
- data/lib/switchman/version.rb +1 -1
- metadata +3 -4
- data/db/shard_1708.sqlite3 +0 -0
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d61d2718f40a07addd2a2bbdbd6835a067800217
|
4
|
+
data.tar.gz: 0e8df6c7e4c19b9a1b270d0580521423e3942a27
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c5117529fa38094b92df0d730747b1b69f2c35fddf1295630153f96ab98969d70f1e7bf541d2261f6138a3a47751a68f56f35d1bc233ac2db7ea2f463d139de2
|
7
|
+
data.tar.gz: 8581bae2c4474151156155d7960c000cae51dfe54d7dde9524f944608c065e267fb7b7aa2e46ea97f279210774301d32509e101d84e0f4cbcab42a7d09a7bd96
|
@@ -213,6 +213,28 @@ module Switchman
|
|
213
213
|
algorithm = nil if DatabaseServer.creating_new_shard && algorithm == "CONCURRENTLY"
|
214
214
|
[index_name, index_type, index_columns, index_options, algorithm, using]
|
215
215
|
end
|
216
|
+
|
217
|
+
def rename_table(table_name, new_name)
|
218
|
+
clear_cache!
|
219
|
+
execute "ALTER TABLE #{quote_table_name(table_name)} RENAME TO #{quote_local_table_name(new_name)}"
|
220
|
+
pk, seq = pk_and_sequence_for(new_name)
|
221
|
+
if pk
|
222
|
+
idx = "#{table_name}_pkey"
|
223
|
+
new_idx = "#{new_name}_pkey"
|
224
|
+
execute "ALTER INDEX #{quote_table_name(idx)} RENAME TO #{quote_local_table_name(new_idx)}"
|
225
|
+
if seq && seq.identifier == "#{table_name}_#{pk}_seq"
|
226
|
+
new_seq = "#{new_name}_#{pk}_seq"
|
227
|
+
execute "ALTER TABLE #{seq.quoted} RENAME TO #{quote_local_table_name(new_seq)}"
|
228
|
+
end
|
229
|
+
end
|
230
|
+
rename_table_indexes(table_name, new_name)
|
231
|
+
end
|
232
|
+
|
233
|
+
def rename_index(table_name, old_name, new_name)
|
234
|
+
validate_index_length!(table_name, new_name)
|
235
|
+
|
236
|
+
execute "ALTER INDEX #{quote_column_name(old_name)} RENAME TO #{quote_local_table_name(new_name)}"
|
237
|
+
end
|
216
238
|
end
|
217
239
|
end
|
218
240
|
end
|
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.10.
|
4
|
+
version: 1.10.3
|
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-
|
13
|
+
date: 2017-08-24 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: railties
|
@@ -177,7 +177,6 @@ files:
|
|
177
177
|
- db/migrate/20130328212039_create_switchman_shards.rb
|
178
178
|
- db/migrate/20130328224244_create_default_shard.rb
|
179
179
|
- db/migrate/20161206323434_add_back_default_string_limits_switchman.rb
|
180
|
-
- db/shard_1708.sqlite3
|
181
180
|
- lib/switchman.rb
|
182
181
|
- lib/switchman/action_controller/caching.rb
|
183
182
|
- lib/switchman/active_record/abstract_adapter.rb
|
@@ -244,7 +243,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
244
243
|
version: '0'
|
245
244
|
requirements: []
|
246
245
|
rubyforge_project:
|
247
|
-
rubygems_version: 2.
|
246
|
+
rubygems_version: 2.6.11
|
248
247
|
signing_key:
|
249
248
|
specification_version: 4
|
250
249
|
summary: Rails 4 sharding magic
|
data/db/shard_1708.sqlite3
DELETED
File without changes
|