masamune 0.17.13 → 0.17.14
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 12cda9508ecb50bf13f5750d645fe67718e51264
|
4
|
+
data.tar.gz: 8d285ef8dfc9370d650852f8063d1925aed943f4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 23a73a59ba63fac580fe66238d760b5097c662d412f06474f2c3916244639e9a8a9dbadf124d7e45b38aa115763151b32fcff73e65fdb9dee446a323d09a57fd
|
7
|
+
data.tar.gz: 34dd1c01933b0a7809fb3101007dcf56d729d197039a77e6275cc67d8e51b3286913826b06ed3cc1087ee0a3b15f3286fa3101f0aebbfa876151b10df3138905
|
@@ -74,7 +74,8 @@ module Masamune::Helpers
|
|
74
74
|
def update_table_last_modified_at(table, column)
|
75
75
|
return if @cache[table].present?
|
76
76
|
postgres(exec: "SELECT MAX(#{column}) FROM #{table};", tuple_output: true, retries: 0) do |line|
|
77
|
-
|
77
|
+
last_modified_at = line.strip
|
78
|
+
@cache[table] = parse_date_time(last_modified_at) unless last_modified_at.blank?
|
78
79
|
end
|
79
80
|
end
|
80
81
|
|
@@ -24,9 +24,6 @@ SELECT pg_advisory_lock(<%= target.lock_id %>);
|
|
24
24
|
|
25
25
|
BEGIN;
|
26
26
|
|
27
|
-
<%-# Relabel version column -%>
|
28
|
-
UPDATE <%= target.name %> SET version = NULL;
|
29
|
-
|
30
27
|
UPDATE
|
31
28
|
<%= target.name %>
|
32
29
|
SET
|
@@ -42,16 +39,11 @@ FROM
|
|
42
39
|
rank() OVER (PARTITION BY <%= target.window.join(', ') %> ORDER BY start_at) AS version
|
43
40
|
FROM
|
44
41
|
<%= target.name %>
|
45
|
-
GROUP BY
|
46
|
-
<%= target.window(:id, :start_at).join(', ') %>
|
47
42
|
) AS tmp
|
48
43
|
WHERE
|
49
44
|
<%= target.name %>.id = tmp.id
|
50
45
|
;
|
51
46
|
|
52
|
-
<%-# Relabel end_at column -%>
|
53
|
-
UPDATE <%= target.name %> SET end_at = NULL;
|
54
|
-
|
55
47
|
UPDATE
|
56
48
|
<%= target.name %>
|
57
49
|
SET
|
@@ -67,8 +59,6 @@ FROM
|
|
67
59
|
LEAD(start_at, 1) OVER (PARTITION BY <%= target.window.join(', ') %> ORDER BY start_at) AS end_at
|
68
60
|
FROM
|
69
61
|
<%= target.name %>
|
70
|
-
GROUP BY
|
71
|
-
<%= target.window(:id, :start_at).join(', ') %>
|
72
62
|
) AS tmp
|
73
63
|
WHERE
|
74
64
|
<%= target.name %>.id = tmp.id
|
data/lib/masamune/version.rb
CHANGED
@@ -74,7 +74,7 @@ describe Masamune::Helpers::Postgres do
|
|
74
74
|
context 'with last_modified_at option' do
|
75
75
|
before do
|
76
76
|
expect(instance).to receive(:table_exists?).and_return(true)
|
77
|
-
expect(instance).to receive(:postgres).with(hash_including(exec: 'SELECT MAX(last_modified_at) FROM foo;', tuple_output: true, retries: 0)).and_yield(output)
|
77
|
+
expect(instance).to receive(:postgres).with(hash_including(exec: 'SELECT MAX(last_modified_at) FROM foo;', tuple_output: true, retries: 0)).and_yield(output).and_yield('')
|
78
78
|
end
|
79
79
|
|
80
80
|
let(:options) { { last_modified_at: 'last_modified_at' } }
|
@@ -50,8 +50,6 @@ describe Masamune::Transform::RelabelDimension do
|
|
50
50
|
|
51
51
|
BEGIN;
|
52
52
|
|
53
|
-
UPDATE user_dimension SET version = NULL;
|
54
|
-
|
55
53
|
UPDATE
|
56
54
|
user_dimension
|
57
55
|
SET
|
@@ -66,15 +64,11 @@ describe Masamune::Transform::RelabelDimension do
|
|
66
64
|
rank() OVER (PARTITION BY tenant_id, user_id ORDER BY start_at) AS version
|
67
65
|
FROM
|
68
66
|
user_dimension
|
69
|
-
GROUP BY
|
70
|
-
id, tenant_id, user_id, start_at
|
71
67
|
) AS tmp
|
72
68
|
WHERE
|
73
69
|
user_dimension.id = tmp.id
|
74
70
|
;
|
75
71
|
|
76
|
-
UPDATE user_dimension SET end_at = NULL;
|
77
|
-
|
78
72
|
UPDATE
|
79
73
|
user_dimension
|
80
74
|
SET
|
@@ -89,8 +83,6 @@ describe Masamune::Transform::RelabelDimension do
|
|
89
83
|
LEAD(start_at, 1) OVER (PARTITION BY tenant_id, user_id ORDER BY start_at) AS end_at
|
90
84
|
FROM
|
91
85
|
user_dimension
|
92
|
-
GROUP BY
|
93
|
-
id, tenant_id, user_id, start_at
|
94
86
|
) AS tmp
|
95
87
|
WHERE
|
96
88
|
user_dimension.id = tmp.id
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: masamune
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.17.
|
4
|
+
version: 0.17.14
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Andrews
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-06-02 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: thor
|