pg_online_schema_change 0.7.5 → 0.8.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: 973cb542595ffacbaa942636be7b366e018a2141a75c1fd73e38e65e263ddd39
4
- data.tar.gz: abe5178f45a6c8a00c0b64a5cee543b7fc22e126d7a5744adefada83fa6ab844
3
+ metadata.gz: 49e57a6481ac80c845becf6dfae0191a14437b8687c02952353c8b64ae584221
4
+ data.tar.gz: 9a19a05b26c944beac56cb298a56e3d345cc3a31dde105c3058e694fe7dc166a
5
5
  SHA512:
6
- metadata.gz: 718ae2f4b7c1f0319f9c36d5c5b6f24441ac94e108fb281d357cec5790ee68ba4fdd1237aae4d414e284ccbf8228796027b9e2d6ffb19730bfe8260acb8120ba
7
- data.tar.gz: 030dbca6e2f7b2a4f117a6b639f7c1454e7df5514adf4c81f3957d0a2310ce62042ea16d9707f6b7f7590c4f2b04f4276de33100bfc7a1611a1df388a21f8e5e
6
+ metadata.gz: f08b73035281a35a173eb5f704e94742b851be7b932c212295d70396f93c3c6b6a68847811f9bd98ecdd142b175e41f970e1df1e04fd0b2956450ae79d50e517
7
+ data.tar.gz: 274afb75e3ba0dd6fdbe4c7a35029f285e5c8fccca6509e0e5cce3fdedf06cfd91c68980037ac4ae811b51fbc901451dbfd75120abaaef92d688eaa2003acb5f
data/.prettierignore ADDED
@@ -0,0 +1,4 @@
1
+ /spec/fixtures
2
+ /docs
3
+ /scripts
4
+ *.sql
data/.prettierrc ADDED
@@ -0,0 +1,13 @@
1
+ {
2
+ "trailingComma": "es5",
3
+ "overrides": [
4
+ {
5
+ "files": ["Gemfile", "*.{rb,ru,rake,gemspec}", ".irbrc", ".pryrc"],
6
+ "options": {
7
+ "printWidth": 100,
8
+ "rubySingleQuote": false,
9
+ "rubyArrayLiteral": false
10
+ }
11
+ }
12
+ ]
13
+ }
data/.rubocop.yml CHANGED
@@ -2,131 +2,260 @@ inherit_from: .rubocop_todo.yml
2
2
 
3
3
  require:
4
4
  - rubocop-rspec
5
- - rubocop-packaging
6
- - rubocop-performance
7
5
  - rubocop-rake
8
6
 
7
+ inherit_mode:
8
+ merge:
9
+ - Include
10
+ - Exclude
11
+ - AllowedMethods
12
+
9
13
  AllCops:
10
- DisplayCopNames: true
11
- DisplayStyleGuide: true
12
14
  NewCops: enable
13
- TargetRubyVersion: 2.6
14
15
  Exclude:
15
- - "tmp/**/*"
16
- - "vendor/**/*"
16
+ - "**/.git/**/*"
17
+ - "**/node_modules/**/*"
18
+ - "**/Brewfile"
19
+ TargetRubyVersion: 3.1
20
+
21
+ Bundler/OrderedGems:
22
+ Include:
23
+ - "**/Gemfile"
17
24
 
18
- Layout/HashAlignment:
19
- EnforcedColonStyle: key
20
- EnforcedHashRocketStyle: key
25
+ Style/FrozenStringLiteralComment:
26
+ EnforcedStyle: always
21
27
 
22
- Layout/SpaceAroundEqualsInParameterDefault:
23
- EnforcedStyle: space
28
+ Style/MutableConstant:
29
+ EnforcedStyle: literals
24
30
 
25
- Metrics/AbcSize:
31
+ Style/MethodCallWithArgsParentheses:
26
32
  Enabled: true
27
- Max: 45
33
+ EnforcedStyle: require_parentheses
34
+ AllowedMethods:
35
+ - yield
36
+ - raise
37
+ - fail
38
+ - puts
39
+ - require
40
+ - require_relative
41
+ - render
42
+ - redirect_to
43
+ - head
44
+ - throw
45
+ # RSpec
46
+ - to
47
+ - not_to
48
+ - to_not
49
+ - and
50
+ - or
28
51
  Exclude:
29
- - "spec/**/*"
52
+ - "**/Gemfile"
53
+ - "**/db/migrate/*"
54
+ - "**/db/schema.rb"
30
55
 
31
- Metrics/BlockLength:
32
- Max: 100
33
- Exclude:
34
- - "*.gemspec"
35
- - "Rakefile"
36
- - "spec/**/*"
56
+ Style/RedundantInitialize:
57
+ Enabled: false
37
58
 
38
- Metrics/ClassLength:
39
- Exclude:
40
- - "test/**/*"
59
+ Layout:
60
+ Enabled: false
41
61
 
42
- Metrics/MethodLength:
43
- Max: 30
44
- Exclude:
45
- - "test/**/*"
62
+ Metrics:
63
+ Enabled: false
46
64
 
47
- Metrics/ParameterLists:
48
- Max: 5
65
+ Naming/AccessorMethodName:
66
+ Enabled: false
49
67
 
50
- Naming/MemoizedInstanceVariableName:
51
- Enabled: true
68
+ Naming/MethodParameterName:
69
+ Enabled: false
70
+
71
+ Naming/PredicateName:
72
+ Enabled: false
52
73
 
53
74
  Naming/VariableNumber:
54
- Enabled: true
75
+ Enabled: false
55
76
 
56
- Style/BarePercentLiterals:
57
- EnforcedStyle: percent_q
77
+ Style/AsciiComments:
78
+ Enabled: false
79
+
80
+ Style/BlockDelimiters:
81
+ Enabled: false
82
+
83
+ Style/CaseLikeIf:
84
+ Enabled: false
58
85
 
59
86
  Style/ClassAndModuleChildren:
60
- Enabled: true
87
+ Enabled: false
88
+
89
+ Style/CommentAnnotation:
90
+ Enabled: false
61
91
 
62
92
  Style/Documentation:
63
93
  Enabled: false
64
94
 
65
- Style/DoubleNegation:
66
- Enabled: true
95
+ Style/IfUnlessModifier:
96
+ Enabled: false
67
97
 
68
- Style/EmptyMethod:
69
- Enabled: true
98
+ Style/Lambda:
99
+ Enabled: false
70
100
 
71
- Style/FrozenStringLiteralComment:
72
- Enabled: true
101
+ Style/ModuleFunction:
102
+ Enabled: false
103
+
104
+ Style/MultilineBlockChain:
105
+ Enabled: false
106
+
107
+ Style/NumericLiterals:
108
+ Enabled: false
73
109
 
74
110
  Style/NumericPredicate:
75
- Enabled: true
111
+ Enabled: false
112
+
113
+ Style/ParallelAssignment:
114
+ Enabled: false
115
+
116
+ Style/PerlBackrefs:
117
+ Enabled: false
118
+
119
+ Style/QuotedSymbols:
120
+ EnforcedStyle: double_quotes
121
+ Enabled: false
122
+
123
+ Style/RaiseArgs:
124
+ Enabled: false
125
+
126
+ Style/RescueStandardError:
127
+ Enabled: false
128
+
129
+ Style/SingleArgumentDig:
130
+ Enabled: false
76
131
 
77
132
  Style/StringLiterals:
78
133
  EnforcedStyle: double_quotes
134
+ Enabled: false
79
135
 
80
136
  Style/StringLiteralsInInterpolation:
81
- EnforcedStyle: double_quotes
137
+ Enabled: false
82
138
 
83
- Style/TrivialAccessors:
84
- AllowPredicates: true
139
+ Style/SymbolArray:
140
+ EnforcedStyle: brackets
85
141
 
86
142
  Style/TrailingCommaInArguments:
87
- EnforcedStyleForMultiline: comma
143
+ Enabled: false
88
144
 
89
145
  Style/TrailingCommaInArrayLiteral:
90
- EnforcedStyleForMultiline: comma
146
+ Enabled: false
147
+ EnforcedStyleForMultiline: consistent_comma
91
148
 
92
149
  Style/TrailingCommaInHashLiteral:
93
- EnforcedStyleForMultiline: comma
150
+ Enabled: false
94
151
 
95
- Layout/MultilineArrayBraceLayout:
96
- Enabled: true
97
- EnforcedStyle: symmetrical
152
+ Style/TrailingUnderscoreVariable:
153
+ Enabled: false
98
154
 
99
- Layout/MultilineHashBraceLayout:
100
- Enabled: true
101
- EnforcedStyle: symmetrical
155
+ Style/WordArray:
156
+ EnforcedStyle: brackets
102
157
 
103
- Layout/MultilineAssignmentLayout:
104
- Enabled: true
105
- EnforcedStyle: same_line
158
+ Style/ZeroLengthPredicate:
159
+ Enabled: false
106
160
 
107
- Layout/FirstArrayElementIndentation:
161
+ Style/DateTime:
108
162
  Enabled: true
109
- EnforcedStyle: consistent
110
163
 
111
- Layout/FirstHashElementIndentation:
112
- Enabled: true
113
- EnforcedStyle: consistent
164
+ RSpec/ExpectChange:
165
+ EnforcedStyle: block
114
166
 
115
- Layout/MultilineHashKeyLineBreaks:
116
- Enabled: true
167
+ Gemspec/RequireMFA:
168
+ # Our Gemspec files are internal, MFA isn't needed
169
+ Enabled: false
117
170
 
118
- Layout/LineLength:
119
- Enabled: true
120
- Max: 250
171
+ # Temporary Rubocop exclusions
172
+ Style/OpenStructUse:
173
+ Enabled: false
121
174
 
122
- Style/FormatStringToken:
123
- Enabled: true
124
- EnforcedStyle: template
175
+ # Ruby 3 migration exclusions
176
+ Style/HashSyntax:
177
+ Enabled: false
178
+
179
+ Naming/BlockForwarding:
180
+ Enabled: false
181
+
182
+ Lint/RedundantDirGlobSort:
183
+ Enabled: false
184
+
185
+ RSpec/ExampleLength:
186
+ Enabled: false
187
+
188
+ RSpec/MultipleExpectations:
189
+ Enabled: false
190
+
191
+ RSpec/VerifiedDoubles:
192
+ Enabled: false
193
+
194
+ RSpec/ContextWording:
195
+ Enabled: false
196
+
197
+ RSpec/AnyInstance:
198
+ Enabled: false
125
199
 
126
200
  RSpec/MessageSpies:
127
- Enabled: true
128
- EnforcedStyle: receive
201
+ Enabled: false
202
+
203
+ RSpec/RepeatedDescription:
204
+ Enabled: false
205
+
206
+ RSpec/RepeatedExample:
207
+ Enabled: false
208
+
209
+ RSpec/HookArgument:
210
+ Enabled: false
211
+
212
+ RSpec/DescribeClass:
213
+ Enabled: false
214
+
215
+ RSpec/DescribedClass:
216
+ Enabled: false
129
217
 
130
218
  RSpec/FilePath:
131
- Enabled: true
132
- SpecSuffixOnly: true
219
+ Enabled: false
220
+
221
+ RSpec/IdenticalEqualityAssertion:
222
+ Enabled: false
223
+
224
+ RSpec/InstanceVariable:
225
+ Enabled: false
226
+
227
+ RSpec/MissingExampleGroupArgument:
228
+ Enabled: false
229
+
230
+ RSpec/MultipleDescribes:
231
+ Enabled: false
232
+
233
+ RSpec/NestedGroups:
234
+ Enabled: false
235
+
236
+ RSpec/PredicateMatcher:
237
+ Enabled: false
238
+
239
+ RSpec/Rails/HttpStatus:
240
+ Enabled: false
241
+
242
+ RSpec/RepeatedExampleGroupDescription:
243
+ Enabled: false
244
+
245
+ RSpec/StubbedMock:
246
+ Enabled: false
247
+
248
+ Lint/UnusedMethodArgument:
249
+ Enabled: false
250
+
251
+ Lint/MissingSuper:
252
+ Enabled: false
253
+
254
+ RSpec/NoExpectationExample:
255
+ Enabled: false
256
+
257
+ Style/AccessorGrouping:
258
+ Enabled: false
259
+
260
+ Style/FormatStringToken:
261
+ Enabled: false
data/.rubocop_todo.yml CHANGED
@@ -1,45 +1,26 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2023-03-12 14:28:52 UTC using RuboCop version 1.23.0.
3
+ # on 2023-05-13 12:53:02 UTC using RuboCop version 1.51.0.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
7
7
  # versions of RuboCop, may require this file to be generated again.
8
8
 
9
- # Offense count: 2
10
- # Configuration parameters: CountComments, CountAsOne.
11
- Metrics/ClassLength:
12
- Max: 285
13
-
14
- # Offense count: 2
15
- # Configuration parameters: IgnoredMethods.
16
- Metrics/CyclomaticComplexity:
17
- Max: 15
18
-
19
- # Offense count: 1
20
- # Configuration parameters: CountComments, CountAsOne.
21
- Metrics/ModuleLength:
22
- Max: 112
23
-
24
- # Offense count: 2
25
- # Configuration parameters: IgnoredMethods.
26
- Metrics/PerceivedComplexity:
27
- Max: 13
9
+ # Offense count: 12
10
+ # Configuration parameters: EnforcedStyle, AllowedGems, Include.
11
+ # SupportedStyles: Gemfile, gems.rb, gemspec
12
+ # Include: **/*.gemspec, **/Gemfile, **/gems.rb
13
+ Gemspec/DevelopmentDependencies:
14
+ Exclude:
15
+ - 'pg_online_schema_change.gemspec'
28
16
 
29
17
  # Offense count: 1
30
- Packaging/GemspecGit:
18
+ # Configuration parameters: Severity, Include.
19
+ # Include: **/*.gemspec
20
+ Gemspec/RequiredRubyVersion:
31
21
  Exclude:
32
22
  - 'pg_online_schema_change.gemspec'
33
23
 
34
- # Offense count: 69
35
- # Configuration parameters: CountAsOne.
36
- RSpec/ExampleLength:
37
- Max: 55
38
-
39
- # Offense count: 25
40
- RSpec/MultipleExpectations:
41
- Max: 14
42
-
43
24
  # Offense count: 6
44
25
  # Configuration parameters: AllowedMethods.
45
26
  # AllowedMethods: respond_to_missing?
data/.ruby-version CHANGED
@@ -1 +1 @@
1
- 3.0.0
1
+ 3.1.3
data/CHANGELOG.md CHANGED
@@ -1,44 +1,64 @@
1
+ ## [0.8.0] - 2023-05-13
1
2
 
3
+ - Ruby 3.1.3 and prettier/ruby https://github.com/shayonj/pg-osc/pull/83
4
+ - Ruby matrix in ci and require ruby 2.7+ https://github.com/shayonj/pg-osc/pull/84
5
+ - Re-enable autovacuum by @jfrost https://github.com/shayonj/pg-osc/pull/85
6
+
7
+ ## [0.7.5] - 2023-03-12
8
+
9
+ - Bump google-protobuf from 3.21.6 to 3.21.7 https://github.com/shayonj/pg-osc/pull/76
10
+ - Supports tablenames containing uppercase letters https://github.com/shayonj/pg-osc/pull/77
11
+ - Update rubocop todo https://github.com/shayonj/pg-osc/pull/78
12
+ - Ensure original triggers are carried over from parent table https://github.com/shayonj/pg-osc/pull/79
2
13
 
3
14
  ## [0.7.4] - 2022-09-24
4
- * off-by-one: Don't skip PK sequence value by one https://github.com/shayonj/pg-osc/pull/74
15
+
16
+ - off-by-one: Don't skip PK sequence value by one https://github.com/shayonj/pg-osc/pull/74
5
17
 
6
18
  ## [0.7.3] - 2022-09-24
7
- * Update primary key sequence on shadow table https://github.com/shayonj/pg-osc/pull/72
19
+
20
+ - Update primary key sequence on shadow table https://github.com/shayonj/pg-osc/pull/72
8
21
  - Thanks to @brycethornton for the report
9
- * Only refresh primary key when a sequence is attached https://github.com/shayonj/pg-osc/pull/73
22
+ - Only refresh primary key when a sequence is attached https://github.com/shayonj/pg-osc/pull/73
10
23
 
11
24
  ## [0.7.2] - 2022-09-17
25
+
12
26
  **NOTE: Skip to 0.7.3. 0.7.2 release missed the change.**
13
- * Update primary key sequence on shadow table https://github.com/shayonj/pg-osc/pull/72
27
+
28
+ - Update primary key sequence on shadow table https://github.com/shayonj/pg-osc/pull/72
14
29
  - Thanks to @brycethornton for the report
15
30
 
16
31
  ## [0.7.1] - 2022-03-13
17
- * Bump pg to `1.3.4` https://github.com/shayonj/pg-osc/commit/d086c19d4f273dc960491cbedf9e0602d812896b
32
+
33
+ - Bump pg to `1.3.4` https://github.com/shayonj/pg-osc/commit/d086c19d4f273dc960491cbedf9e0602d812896b
18
34
 
19
35
  ## [0.7.0] - 2022-03-13
20
- * Move CI to Github Actions in https://github.com/shayonj/pg-osc/pull/64
21
- * Set --password as optional since it is deprecated in https://github.com/shayonj/pg-osc/pull/66
22
- * Smoke tests in https://github.com/shayonj/pg-osc/pull/65
23
- * Add foreign keys to parent during swap in https://github.com/shayonj/pg-osc/pull/67
36
+
37
+ - Move CI to Github Actions in https://github.com/shayonj/pg-osc/pull/64
38
+ - Set --password as optional since it is deprecated in https://github.com/shayonj/pg-osc/pull/66
39
+ - Smoke tests in https://github.com/shayonj/pg-osc/pull/65
40
+ - Add foreign keys to parent during swap in https://github.com/shayonj/pg-osc/pull/67
24
41
 
25
42
  ## [0.6.0] - 2022-02-26
26
- * Delete items by audit table PK when replaying by @shayonj @jfrost in https://github.com/shayonj/pg-osc/pull/60
43
+
44
+ - Delete items by audit table PK when replaying by @shayonj @jfrost in https://github.com/shayonj/pg-osc/pull/60
27
45
  - Fixes a race condition issue: https://github.com/shayonj/pg-osc/issues/58
28
46
 
29
47
  ## [0.5.0] - 2022-02-26
30
- * Share some preliminary load test figures in https://github.com/shayonj/pg-osc/pull/54
31
- * Reuse existing transaction open for reading table columns in https://github.com/shayonj/pg-osc/pull/53
32
- * Start to deprecate --password with PGPASSWORD in https://github.com/shayonj/pg-osc/pull/56
33
- * Introduce configurable PULL_BATCH_COUNT and DELTA_COUNT in https://github.com/shayonj/pg-osc/pull/57
48
+
49
+ - Share some preliminary load test figures in https://github.com/shayonj/pg-osc/pull/54
50
+ - Reuse existing transaction open for reading table columns in https://github.com/shayonj/pg-osc/pull/53
51
+ - Start to deprecate --password with PGPASSWORD in https://github.com/shayonj/pg-osc/pull/56
52
+ - Introduce configurable PULL_BATCH_COUNT and DELTA_COUNT in https://github.com/shayonj/pg-osc/pull/57
34
53
 
35
54
  ## [0.4.0] - 2022-02-22
36
- * Lint sourcecode, setup Rubocop proper and Lint in CI by @shayonj in https://github.com/shayonj/pg-osc/pull/46
37
- * Uniquely identify operation_type column by @shayonj in https://github.com/shayonj/pg-osc/pull/50
38
- * Introduce primary key on audit table for ordered reads by @shayonj in https://github.com/shayonj/pg-osc/pull/49
55
+
56
+ - Lint sourcecode, setup Rubocop proper and Lint in CI by @shayonj in https://github.com/shayonj/pg-osc/pull/46
57
+ - Uniquely identify operation_type column by @shayonj in https://github.com/shayonj/pg-osc/pull/50
58
+ - Introduce primary key on audit table for ordered reads by @shayonj in https://github.com/shayonj/pg-osc/pull/49
39
59
  - This addresses an edge case with replay.
40
- * Uniquely identify trigger_time column by @shayonj in https://github.com/shayonj/pg-osc/pull/51
41
- * Abstract assertions into a helper function by @shayonj in https://github.com/shayonj/pg-osc/pull/52
60
+ - Uniquely identify trigger_time column by @shayonj in https://github.com/shayonj/pg-osc/pull/51
61
+ - Abstract assertions into a helper function by @shayonj in https://github.com/shayonj/pg-osc/pull/52
42
62
 
43
63
  ## [0.3.0] - 2022-02-21
44
64
 
@@ -53,8 +73,8 @@
53
73
 
54
74
  Initial release
55
75
 
56
- pg-online-schema-change (`pg-osc`) is a tool for making schema changes (any `ALTER` statements) in Postgres tables with minimal locks, thus helping achieve zero downtime schema changes against production workloads.
76
+ pg-online-schema-change (`pg-osc`) is a tool for making schema changes (any `ALTER` statements) in Postgres tables with minimal locks, thus helping achieve zero downtime schema changes against production workloads.
57
77
 
58
78
  `pg-osc` uses the concept of shadow table to perform schema changes. At a high level, it copies the contents from a primary table to a shadow table, performs the schema change on the shadow table and swaps the table names in the end while preserving all changes to the primary table using triggers (via audit table).
59
79
 
60
- Checkout [Readme](https://github.com/shayonj/pg-osc#readme) for more details.
80
+ Checkout [Readme](https://github.com/shayonj/pg-osc#readme) for more details.
data/CODE_OF_CONDUCT.md CHANGED
@@ -10,21 +10,21 @@ We pledge to act and interact in ways that contribute to an open, welcoming, div
10
10
 
11
11
  Examples of behavior that contributes to a positive environment for our community include:
12
12
 
13
- * Demonstrating empathy and kindness toward other people
14
- * Being respectful of differing opinions, viewpoints, and experiences
15
- * Giving and gracefully accepting constructive feedback
16
- * Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
- * Focusing on what is best not just for us as individuals, but for the overall community
13
+ - Demonstrating empathy and kindness toward other people
14
+ - Being respectful of differing opinions, viewpoints, and experiences
15
+ - Giving and gracefully accepting constructive feedback
16
+ - Accepting responsibility and apologizing to those affected by our mistakes, and learning from the experience
17
+ - Focusing on what is best not just for us as individuals, but for the overall community
18
18
 
19
19
  Examples of unacceptable behavior include:
20
20
 
21
- * The use of sexualized language or imagery, and sexual attention or
21
+ - The use of sexualized language or imagery, and sexual attention or
22
22
  advances of any kind
23
- * Trolling, insulting or derogatory comments, and personal or political attacks
24
- * Public or private harassment
25
- * Publishing others' private information, such as a physical or email
23
+ - Trolling, insulting or derogatory comments, and personal or political attacks
24
+ - Public or private harassment
25
+ - Publishing others' private information, such as a physical or email
26
26
  address, without their explicit permission
27
- * Other conduct which could reasonably be considered inappropriate in a
27
+ - Other conduct which could reasonably be considered inappropriate in a
28
28
  professional setting
29
29
 
30
30
  ## Enforcement Responsibilities
@@ -67,7 +67,7 @@ Community leaders will follow these Community Impact Guidelines in determining t
67
67
 
68
68
  ### 4. Permanent Ban
69
69
 
70
- **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
70
+ **Community Impact**: Demonstrating a pattern of violation of community standards, including sustained inappropriate behavior, harassment of an individual, or aggression toward or disparagement of classes of individuals.
71
71
 
72
72
  **Consequence**: A permanent ban from any sort of public interaction within the community.
73
73