switchman 3.5.4 → 3.5.5

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
  SHA256:
3
- metadata.gz: 524551c3432d001d8cbfc030baa81bf534d75b4fd9ac8a5224a018bd31ef40d8
4
- data.tar.gz: 0dbb04287be903ca4ec0c08df57fbc2f7913795baf3ae14cde806eb0c145b3a7
3
+ metadata.gz: a1565732de1d00cf5e04683eb1d14da6e7a6407aab14dc036ff85b400de8fded
4
+ data.tar.gz: 6b47f28566414d1bacb7089d5a836c72246ddcdd864f0635950823a80418b09e
5
5
  SHA512:
6
- metadata.gz: 9fc1195f6ae2b2d5c8041610c3bd2bd814a25db507ead5263a5bbe42331d852d21f2b8b9bb143ea8ee78f0d16303386e3f42a2acda8aabbdd862efab3fe17e7e
7
- data.tar.gz: c2a6ca3e3347342474a04e882c2b10635219404427b80b3c89d1d7a26686cc15355a8c3fcf60972ce2a8ed44a7fcdb020958c7611046653d5f53e47f087d85ca
6
+ metadata.gz: 41352fccd2fe5346655e06820b8d0afe5f560480b3978f3bbca500dbc62e198a38b3fda435bef7d6d0836887343970a0a35b4fc866132e8331f7dcbfd6ba6cc8
7
+ data.tar.gz: 3d3fb827b20c7495b6bb70eaa054ed0a972a1ad823861abe7a00b5cf77d80cbbc58e3f9077d02acd3847e2b59ea24501abd525b7116d794dc626fded8430537b
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Switchman
4
- VERSION = "3.5.4"
4
+ VERSION = "3.5.5"
5
5
  end
@@ -209,21 +209,28 @@ module Switchman
209
209
 
210
210
  module ActiveRecord
211
211
  module PostgreSQLDatabaseTasks
212
- def structure_dump(filename, extra_flags = nil)
213
- set_psql_env
214
- args = ["--schema-only", "--no-privileges", "--no-owner", "--file", filename]
215
- args.concat(Array(extra_flags)) if extra_flags
216
- shard = Shard.current.name
217
- serialized_search_path = shard
218
- args << "--schema=#{Shellwords.escape(shard)}"
219
-
220
- ignore_tables = ::ActiveRecord::SchemaDumper.ignore_tables
221
- args += ignore_tables.flat_map { |table| ["-T", table] } if ignore_tables.any?
222
-
223
- args << db_config.database
224
- run_cmd("pg_dump", args, "dumping")
225
- remove_sql_header_comments(filename)
226
- File.open(filename, "a") { |f| f << "SET search_path TO #{serialized_search_path};\n\n" }
212
+ if ::Rails.version < "7.0"
213
+ def structure_dump(filename, extra_flags = nil)
214
+ set_psql_env
215
+ args = ["--schema-only", "--no-privileges", "--no-owner", "--file", filename]
216
+ args.concat(Array(extra_flags)) if extra_flags
217
+ shard = Shard.current.name
218
+ serialized_search_path = shard
219
+ args << "--schema=#{Shellwords.escape(shard)}"
220
+
221
+ ignore_tables = ::ActiveRecord::SchemaDumper.ignore_tables
222
+ args += ignore_tables.flat_map { |table| ["-T", table] } if ignore_tables.any?
223
+
224
+ args << db_config.database
225
+ run_cmd("pg_dump", args, "dumping")
226
+ remove_sql_header_comments(filename)
227
+ File.open(filename, "a") { |f| f << "SET search_path TO #{serialized_search_path};\n\n" }
228
+ end
229
+ else
230
+ def structure_dump(...)
231
+ ::ActiveRecord.dump_schemas = Switchman::Shard.current.name
232
+ super
233
+ end
227
234
  end
228
235
  end
229
236
  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: 3.5.4
4
+ version: 3.5.5
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: 2023-06-21 00:00:00.000000000 Z
13
+ date: 2023-07-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: activerecord