pg_saurus 5.1.0 → 5.3.0
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/core_ext/active_record/connection_adapters/postgresql/schema_statements.rb +1 -1
- data/lib/pg_saurus/connection_adapters/abstract_adapter/schema_methods.rb +4 -2
- data/lib/pg_saurus/connection_adapters/postgresql_adapter/foreign_key_methods.rb +6 -6
- data/lib/pg_saurus/connection_adapters/postgresql_adapter/schema_methods.rb +1 -1
- data/lib/pg_saurus/schema_dumper/function_methods.rb +1 -1
- data/lib/pg_saurus/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e4dfa9fa5e2ea0cf5c38fc323434ff9a8e2fd0fc051adf45e378d31d09bfd3bb
|
4
|
+
data.tar.gz: db821a3566aea980399af5d4178771d42b7aac460549905e8f2765690e930562
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8b5c252cba03504a37fb499a6c38fb7a97807025ff3aa0e9574a12036fa1583b7d4307d5398a3aaa0dda2979a764a5d7af3c8a96da80e6ae7d399c268b234e75
|
7
|
+
data.tar.gz: c5b8a0629e1a25d53e52f57451e9efa54f8e31a5b8abab97f0b1de624eca446893785a53e2b54d372bb0a0f1e83fd128cd0bb27badc816d5fd093a57e35cc762
|
@@ -225,7 +225,7 @@ module ActiveRecord
|
|
225
225
|
end
|
226
226
|
|
227
227
|
# Override super method to provide support for expression column names.
|
228
|
-
def quoted_columns_for_index(column_names,
|
228
|
+
def quoted_columns_for_index(column_names, options = {})
|
229
229
|
return [column_names] if column_names.is_a?(String)
|
230
230
|
|
231
231
|
quoted_columns = Hash[
|
@@ -5,14 +5,16 @@ module PgSaurus::ConnectionAdapters::AbstractAdapter::SchemaMethods
|
|
5
5
|
# Provide :schema option to +create_table+ method.
|
6
6
|
def create_table(table_name, options = {}, &block)
|
7
7
|
table_name, options = extract_table_options(table_name, options)
|
8
|
-
super(table_name, options, &block)
|
8
|
+
super(table_name, **options, &block)
|
9
9
|
end
|
10
10
|
|
11
11
|
# Provide :schema option to +drop_table+ method.
|
12
12
|
def drop_table(table_name, options = {})
|
13
|
-
|
13
|
+
table_name, options = extract_table_options(table_name, options)
|
14
|
+
super(table_name, **options)
|
14
15
|
end
|
15
16
|
|
17
|
+
# Extract the table-specific options for the given table name from the options.
|
16
18
|
def extract_table_options(table_name, options)
|
17
19
|
options = options.dup
|
18
20
|
schema_name = options.delete(:schema)
|
@@ -34,7 +34,7 @@ module PgSaurus # :nodoc:
|
|
34
34
|
" Use :exclude_index => true when adding the foreign key."
|
35
35
|
end
|
36
36
|
|
37
|
-
super from_table, to_table, options
|
37
|
+
super from_table, to_table, **options
|
38
38
|
|
39
39
|
unless exclude_index
|
40
40
|
add_index from_table, column
|
@@ -44,14 +44,14 @@ module PgSaurus # :nodoc:
|
|
44
44
|
# See activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
|
45
45
|
#
|
46
46
|
# Pass in the option remove_index: true to remove index as well.
|
47
|
-
def remove_foreign_key(from_table,
|
48
|
-
if
|
49
|
-
column =
|
47
|
+
def remove_foreign_key(from_table, to_table = nil, **options)
|
48
|
+
if options[:remove_index]
|
49
|
+
column = options[:column]
|
50
50
|
remove_index from_table, column
|
51
|
-
|
51
|
+
options.delete(:remove_index)
|
52
52
|
end
|
53
53
|
|
54
|
-
super(from_table,
|
54
|
+
super(from_table, to_table, **options)
|
55
55
|
end
|
56
56
|
|
57
57
|
# See: activerecord/lib/active_record/connection_adapters/abstract/schema_statements.rb
|
@@ -27,7 +27,7 @@ module PgSaurus::ConnectionAdapters::PostgreSQLAdapter::SchemaMethods
|
|
27
27
|
options = options.dup
|
28
28
|
schema_name = options.delete(:schema)
|
29
29
|
table_name = "#{schema_name}.#{table_name}" if schema_name
|
30
|
-
super(table_name, options)
|
30
|
+
super(table_name, **options)
|
31
31
|
end
|
32
32
|
|
33
33
|
# Make method +tables+ return tables not only from public schema.
|
@@ -15,7 +15,7 @@ module PgSaurus::SchemaDumper::FunctionMethods
|
|
15
15
|
# Writes out a command to create each detected function.
|
16
16
|
def dump_functions(stream)
|
17
17
|
@connection.functions.each do |function|
|
18
|
-
statement = " create_function '#{function.name}',
|
18
|
+
statement = " create_function '#{function.name}', '#{function.returning}', <<-FUNCTION_DEFINITION.gsub(/^[\s]{4}/, ''), volatility: :#{function.volatility}"
|
19
19
|
statement << "\n#{function.definition.split("\n").map{|line| " #{line}" }.join("\n")}"
|
20
20
|
statement << "\n FUNCTION_DEFINITION\n\n"
|
21
21
|
|
data/lib/pg_saurus/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pg_saurus
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.
|
4
|
+
version: 5.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Potapov Sergey
|
@@ -13,7 +13,7 @@ authors:
|
|
13
13
|
autorequire:
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2022-
|
16
|
+
date: 2022-07-09 00:00:00.000000000 Z
|
17
17
|
dependencies:
|
18
18
|
- !ruby/object:Gem::Dependency
|
19
19
|
name: pg
|