torque-postgresql 3.2.0 → 3.2.1
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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f08898e4218d41dbcc6394500243760cdd29425ad77135a623bea043cfa8d3ae
|
4
|
+
data.tar.gz: 93c5d71e1597364b7e434e6c88faf4cfd64dcbc930756398f7539dc525a21f05
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7f93afd26ff711ba03f5a5b1381a139690acf8d3a5621ddec1d26a94ae345c2a59e06cdd9805a5101b4d81f51c151ea0fd19bba7a66d080d05387b073cfd55a
|
7
|
+
data.tar.gz: 5db371506b24fe1c5e28aee69054a83724af93642f44cd3646f6aa9ff9bd58b7a2d2632a186762dca570e2adb0ceea1c38cec5d0119b8f0e4e882b4089913895
|
@@ -194,23 +194,21 @@ module Torque
|
|
194
194
|
|
195
195
|
# Get the list of columns, and their definition, but only from the
|
196
196
|
# actual table, does not include columns that comes from inherited table
|
197
|
-
def column_definitions(table_name)
|
198
|
-
|
199
|
-
local_condition = 'AND a.attislocal IS TRUE' if @_dump_mode
|
197
|
+
def column_definitions(table_name)
|
198
|
+
local = 'AND a.attislocal' if @_dump_mode
|
200
199
|
|
201
200
|
query(<<-SQL, 'SCHEMA')
|
202
|
-
|
203
|
-
|
204
|
-
|
205
|
-
|
206
|
-
|
207
|
-
|
208
|
-
|
209
|
-
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
ORDER BY a.attnum
|
201
|
+
SELECT a.attname, format_type(a.atttypid, a.atttypmod),
|
202
|
+
pg_get_expr(d.adbin, d.adrelid), a.attnotnull, a.atttypid, a.atttypmod,
|
203
|
+
c.collname, col_description(a.attrelid, a.attnum) AS comment,
|
204
|
+
#{supports_virtual_columns? ? 'attgenerated' : quote('')} as attgenerated
|
205
|
+
FROM pg_attribute a
|
206
|
+
LEFT JOIN pg_attrdef d ON a.attrelid = d.adrelid AND a.attnum = d.adnum
|
207
|
+
LEFT JOIN pg_type t ON a.atttypid = t.oid
|
208
|
+
LEFT JOIN pg_collation c ON a.attcollation = c.oid AND a.attcollation <> t.typcollation
|
209
|
+
WHERE a.attrelid = #{quote(quote_table_name(table_name))}::regclass
|
210
|
+
AND a.attnum > 0 AND NOT a.attisdropped #{local}
|
211
|
+
ORDER BY a.attnum
|
214
212
|
SQL
|
215
213
|
end
|
216
214
|
|
@@ -112,6 +112,11 @@ module Torque
|
|
112
112
|
|
113
113
|
private
|
114
114
|
|
115
|
+
# Remove the schema from the sequence name
|
116
|
+
def sequence_name_from_parts(table_name, column_name, suffix)
|
117
|
+
super(table_name.split('.').last, column_name, suffix)
|
118
|
+
end
|
119
|
+
|
115
120
|
def quote_enum_values(name, values, options)
|
116
121
|
prefix = options[:prefix]
|
117
122
|
prefix = name if prefix === true
|
@@ -59,11 +59,11 @@ module Torque
|
|
59
59
|
# arguments to format string or send on a proc
|
60
60
|
cte.send_arguments_key = :args
|
61
61
|
|
62
|
-
# Estipulate a class name (which may contain namespace) that
|
62
|
+
# Estipulate a class name (which may contain namespace) that exposes the
|
63
63
|
# auxiliary statement in order to perform detached CTEs
|
64
64
|
cte.exposed_class = 'TorqueCTE'
|
65
65
|
|
66
|
-
# Estipulate a class name (which may contain namespace) that
|
66
|
+
# Estipulate a class name (which may contain namespace) that exposes the
|
67
67
|
# recursive auxiliary statement in order to perform detached CTEs
|
68
68
|
cte.exposed_recursive_class = 'TorqueRecursiveCTE'
|
69
69
|
|
data/spec/tests/schema_spec.rb
CHANGED
@@ -73,6 +73,15 @@ RSpec.describe 'Schema' do
|
|
73
73
|
expect(dump_result).to match /create_table \"users\",.*schema: +"internal"/
|
74
74
|
end
|
75
75
|
end
|
76
|
+
|
77
|
+
it 'does not affect serial ids' do
|
78
|
+
connection.create_table(:primary_keys, id: :serial) do |t|
|
79
|
+
t.string :title
|
80
|
+
end
|
81
|
+
|
82
|
+
parts = '"primary_keys", id: :serial, force: :cascade'
|
83
|
+
expect(dump_result).to match(/create_table #{parts} do /)
|
84
|
+
end
|
76
85
|
end
|
77
86
|
|
78
87
|
context 'on relation' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: torque-postgresql
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Carlos Silva
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-01-06 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|