zuora_connect 1.7.42 → 1.7.43
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
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fdca57b64a49a8871c3d819a95a2a1128f44afe6
|
4
|
+
data.tar.gz: a0d6c50a46bb77f8f004b5668b332552c90749c6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: cbfb352159b9ba62f8a549b5b23fe3fdbb730e10e642e58e22b16d148c4f8df0d8142f3f69c688fc88410dd2be63e7fc7875aad869aab96abbf7f44141c72b3d
|
7
|
+
data.tar.gz: b5214f4079d92ae7f354a2a3b683b5d6f12d26c65c4dc9a64a953c915c898713f5a452fb537706c47a1c1cf21c7777d1c466eb0d071cc865944d3788bf7e0590
|
@@ -797,9 +797,11 @@ module ZuoraConnect
|
|
797
797
|
### START Aggregate Grouping Helping Methods ####
|
798
798
|
def self.refresh_aggregate_table(aggregate_name: 'all_tasks_processing', table_name: 'tasks', where_clause: "where status in ('Processing', 'Queued')", index_table: true)
|
799
799
|
self.update_functions
|
800
|
-
|
801
|
-
|
802
|
-
|
800
|
+
if index_table
|
801
|
+
ActiveRecord::Base.connection.execute('SELECT "shared_extensions".refresh_aggregate_table(\'%s\', \'%s\', %s, \'Index\');' % [aggregate_name, table_name, ActiveRecord::Base.connection.quote(where_clause)])
|
802
|
+
else
|
803
|
+
ActiveRecord::Base.connection.execute('SELECT "shared_extensions".refresh_aggregate_table(\'%s\', \'%s\', %s, \'NO\');' % [aggregate_name, table_name, ActiveRecord::Base.connection.quote(where_clause)])
|
804
|
+
end
|
803
805
|
end
|
804
806
|
|
805
807
|
def self.update_functions
|
@@ -10,75 +10,76 @@ DECLARE
|
|
10
10
|
index_string varchar;
|
11
11
|
index_id varchar;
|
12
12
|
BEGIN
|
13
|
-
|
14
|
-
raise notice 'Starting aggregate of % to %', table_name, aggregate_table_name;
|
13
|
+
raise notice 'Starting aggregate of % to %', table_name, aggregate_table_name;
|
15
14
|
|
16
15
|
|
17
|
-
|
18
|
-
|
16
|
+
EXECUTE format('DROP TABLE IF EXISTS "public".%I', aggregate_table_name);
|
17
|
+
raise notice 'Filter %', filter;
|
19
18
|
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
EXECUTE format(
|
28
|
-
'CREATE TABLE "public".%I (LIKE %I.%I)',
|
29
|
-
aggregate_table_name,
|
30
|
-
schema.schema_name, table_name
|
31
|
-
);
|
32
|
-
-- Add a special `schema_name` column, which we'll populate with the name of the schema
|
33
|
-
-- each row originated from
|
34
|
-
EXECUTE format(
|
35
|
-
'ALTER TABLE "public".%I ADD COLUMN schema_name text', aggregate_table_name
|
36
|
-
);
|
37
|
-
created := true;
|
38
|
-
END IF;
|
39
|
-
|
40
|
-
-- Finally, we'll select everything from this schema's target table, plus the schema's name,
|
41
|
-
-- and insert them into our new aggregate table
|
19
|
+
FOR schema IN EXECUTE
|
20
|
+
format(
|
21
|
+
'SELECT schema_name FROM information_schema.schemata WHERE schema_name ~ ''^[0-9]+$'''
|
22
|
+
)
|
23
|
+
LOOP
|
24
|
+
IF NOT created THEN
|
25
|
+
-- Create the aggregate table if we haven't already
|
42
26
|
EXECUTE format(
|
43
|
-
'
|
44
|
-
table_name, schema.schema_name
|
45
|
-
) into fields_order;
|
46
|
-
|
47
|
-
raise notice 'Importing Schema %', schema.schema_name;
|
48
|
-
|
49
|
-
EXECUTE format(
|
50
|
-
'INSERT INTO "public".%I (schema_name, %s) (SELECT ''%s'' AS schema_name, * FROM %I.%I %s )',
|
27
|
+
'CREATE TABLE "public".%I (LIKE %I.%I)',
|
51
28
|
aggregate_table_name,
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
29
|
+
schema.schema_name, table_name
|
30
|
+
);
|
31
|
+
-- Add a special `schema_name` column, which we'll populate with the name of the schema
|
32
|
+
-- each row originated from
|
33
|
+
EXECUTE format(
|
34
|
+
'ALTER TABLE "public".%I ADD COLUMN schema_name text', aggregate_table_name
|
56
35
|
);
|
57
|
-
END LOOP;
|
58
36
|
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
37
|
+
EXECUTE
|
38
|
+
format('CREATE INDEX ON "public".%I (schema_name)', aggregate_table_name);
|
39
|
+
EXECUTE
|
40
|
+
format('CREATE INDEX ON "public".%I (id)', aggregate_table_name);
|
41
|
+
|
42
|
+
-- Move indexes over if indexable
|
43
|
+
IF mode = 'Index' THEN
|
44
|
+
FOR index_string, index_name, index_id IN
|
45
|
+
SELECT pg_get_indexdef(idx.oid)||';', idx.relname, idx.oid
|
46
|
+
from pg_index ind
|
47
|
+
join pg_class idx on idx.oid = ind.indexrelid
|
48
|
+
join pg_class tbl on tbl.oid = ind.indrelid
|
49
|
+
left join pg_namespace ns on ns.oid = tbl.relnamespace where idx.relname != concat(table_name, '_pkey') and tbl.relname = table_name and ns.nspname = 'public'
|
50
|
+
LOOP
|
51
|
+
BEGIN
|
52
|
+
EXECUTE
|
53
|
+
format('DROP INDEX IF EXISTS "public"."%s"', concat(aggregate_table_name, '_', index_id));
|
54
|
+
|
55
|
+
EXECUTE
|
56
|
+
format(replace(replace(replace(index_string, index_name, concat(aggregate_table_name, '_', index_id)), concat(' ', table_name, ' '), concat( ' ', aggregate_table_name, ' ')), concat('public.', table_name), concat( 'public.', aggregate_table_name)));
|
57
|
+
|
58
|
+
RAISE NOTICE 'Creating Indexes %', replace(replace(replace(index_string, index_name, concat(aggregate_table_name, '_', index_id)), concat(' ', table_name, ' '), concat( ' ', aggregate_table_name, ' ')), concat('public.', table_name), concat( 'public.', aggregate_table_name)) ;
|
59
|
+
END;
|
60
|
+
END LOOP;
|
61
|
+
END IF;
|
62
|
+
|
63
|
+
created := true;
|
64
|
+
END IF;
|
75
65
|
|
76
|
-
|
77
|
-
|
66
|
+
-- Finally, we'll select everything from this schema's target table, plus the schema's name,
|
67
|
+
-- and insert them into our new aggregate table
|
68
|
+
EXECUTE format(
|
69
|
+
'SELECT string_agg(column_name, '','') from information_schema.columns where table_name = ''%s'' AND table_schema = ''%s''',
|
70
|
+
table_name, schema.schema_name
|
71
|
+
) into fields_order;
|
72
|
+
|
73
|
+
raise notice 'Importing Schema %', schema.schema_name;
|
78
74
|
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
75
|
+
EXECUTE format(
|
76
|
+
'INSERT INTO "public".%I (schema_name, %s) (SELECT ''%s'' AS schema_name, * FROM %I.%I %s )',
|
77
|
+
aggregate_table_name,
|
78
|
+
fields_order,
|
79
|
+
schema.schema_name,
|
80
|
+
schema.schema_name, table_name,
|
81
|
+
filter
|
82
|
+
);
|
83
|
+
END LOOP;
|
83
84
|
END
|
84
85
|
$$ LANGUAGE plpgsql;
|
@@ -79,6 +79,7 @@ module ZuoraConnect
|
|
79
79
|
@appinstance = ZuoraConnect::AppInstance.find(app_instance_ids[0])
|
80
80
|
@appinstance.new_session(session: {})
|
81
81
|
@appinstance.cache_app_instance
|
82
|
+
session["appInstance"] = app_instance_ids[0]
|
82
83
|
else
|
83
84
|
Rails.logger.fatal("Launch Error: Param Instance didnt match session data")
|
84
85
|
render "zuora_connect/static/invalid_launch_request"
|
@@ -101,6 +102,7 @@ module ZuoraConnect
|
|
101
102
|
@appinstance = ZuoraConnect::AppInstance.find(params[:app_instance_id].to_i)
|
102
103
|
@appinstance.new_session(session: {})
|
103
104
|
@appinstance.cache_app_instance
|
105
|
+
session["appInstance"] = params[:app_instance_id].to_i
|
104
106
|
else
|
105
107
|
render "zuora_connect/static/invalid_launch_request"
|
106
108
|
return
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: zuora_connect
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.7.
|
4
|
+
version: 1.7.43
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Connect Team
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-12-
|
11
|
+
date: 2018-12-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: apartment
|