File tree Expand file tree Collapse file tree 1 file changed +17
-6
lines changed
lib/torque/postgresql/adapter Expand file tree Collapse file tree 1 file changed +17
-6
lines changed Original file line number Diff line number Diff line change @@ -20,6 +20,19 @@ def schema_type(column)
20
20
private
21
21
22
22
def tables ( stream ) # :nodoc:
23
+ around_tables ( stream ) { dump_tables ( stream ) }
24
+ end
25
+
26
+ def around_tables ( stream )
27
+ functions ( stream ) if fx_functions_position == :beginning
28
+
29
+ yield
30
+
31
+ functions ( stream ) if fx_functions_position == :end
32
+ triggers ( stream ) if defined? ( ::Fx ::SchemaDumper ::Trigger )
33
+ end
34
+
35
+ def dump_tables ( stream )
23
36
inherited_tables = @connection . inherited_tables
24
37
sorted_tables = @connection . tables . sort - @connection . views
25
38
@@ -55,13 +68,11 @@ def tables(stream) # :nodoc:
55
68
foreign_keys ( tbl , stream ) unless ignored? ( tbl )
56
69
end
57
70
end
71
+ end
58
72
59
- # Scenic integration
60
- views ( stream ) if defined? ( ::Scenic )
61
-
62
- # FX integration
63
- functions ( stream ) if defined? ( ::Fx ::SchemaDumper ::Function )
64
- triggers ( stream ) if defined? ( ::Fx ::SchemaDumper ::Trigger )
73
+ def fx_functions_position
74
+ return unless defined? ( ::Fx ::SchemaDumper ::Function )
75
+ Fx . configuration . dump_functions_at_beginning_of_schema ? :beginning : :end
65
76
end
66
77
end
67
78
You can’t perform that action at this time.
0 commit comments