rubocop-oracle 0.1.0 → 0.2.0

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
  SHA256:
3
- metadata.gz: f08071efb4fee0574a8a1665daf6a4206c836de8a8f3924a6b74b1267e654f46
4
- data.tar.gz: 2193018fe03e09ed648a00639edf46dfe663148f29d0e61d64487af1b21857f9
3
+ metadata.gz: 4386eee3acd95655ca1eed299d20110d745f177d6d7e3c7583544c19f5d1d5e1
4
+ data.tar.gz: e0c8eab371f6a6d3c9bf915c581a42507596aea50e767ce4101a613469323b9a
5
5
  SHA512:
6
- metadata.gz: 332761e4fabe2affbb55327b46b6e8d60a6620a59f91aabbe3b770a0e1ac3bf267ae02878698800c621651e28aac4d8e27ea92b0d7f22801900fc1bda5ff1804
7
- data.tar.gz: 2c67d042742a50cc6d784e9769b7f705ec6a29ca3b5b08918518c348685f2fb5edbd2a757a308cc99d926477bc50215238ff127c87b4a88708b4f717adafb08b
6
+ metadata.gz: 248f4e8662943bee026bf35a02a97d3785e9081589d279f6e2331685830ece09f4cd59af73bea1821aa188ae7a03587b02335f8f85c3cc04e98c5b7be2feee95
7
+ data.tar.gz: ed9f6f5197432d7f96596293af50945dc0d226d1960dc1b9b635ae2227aef0d0e48eaec406eeb46070fbb28074073402d5ae14e577afab2a17210dba2000cf0d
data/CHANGELOG.md CHANGED
@@ -2,6 +2,12 @@
2
2
 
3
3
  ## master (unreleased)
4
4
 
5
+ ## 0.2.0 (2021-04-14)
6
+
7
+ ### Changes
8
+
9
+ * Mark `Oracle/OnlineIndex` as unsafe auto-correction. ([@koic][])
10
+
5
11
  ## 0.1.0 (2021-04-13)
6
12
 
7
13
  ### New features
data/README.md CHANGED
@@ -19,6 +19,34 @@ or if you use bundler put this in your `Gemfile`
19
19
  gem 'rubocop-oracle'
20
20
  ```
21
21
 
22
+ ## Cops
23
+
24
+ This gem contains `Oracle/OnlineIndex` cop to check if indexing is possible without stopping Rails application' service using Oracle.
25
+ The cop supports safe migration for your production environment.
26
+
27
+ ### `Oracle/OnlineIndex` cop
28
+
29
+ This cop checks for uses `options: online` option on `add_index`.
30
+ The `ONLINE` option is required if you want to run with OLTP when indexing migration in Oracle.
31
+
32
+ ```ruby
33
+ # bad
34
+ add_index :table_name, :column_name
35
+
36
+ # good
37
+ add_index :table_name, :column_name, options: :online
38
+ ```
39
+
40
+ By specifying `MigratedSchemaVersion` option, migration files that have been migrated can be ignored.
41
+
42
+ ```yaml
43
+ # .rubocop.yml
44
+ Oracle/OnlineIndex:
45
+ MigratedSchemaVersion: '202104130150' # Migration files lower than or equal to '202104130150' will be ignored.
46
+ ```
47
+
48
+ This prevents detection of migration files that have already been applied to the production environment.
49
+
22
50
  ## Usage
23
51
 
24
52
  You need to tell RuboCop to load the Oracle extension. There are three
data/config/default.yml CHANGED
@@ -20,7 +20,9 @@ AllCops:
20
20
  Oracle/OnlineIndex:
21
21
  Description: 'Checks for uses `options: online` option on `add_index`.'
22
22
  Enabled: true
23
+ SafeAutoCorrect: false
23
24
  VersionAdded: '0.1'
25
+ VersionChanged: '0.2'
24
26
  MigratedSchemaVersion: ~
25
27
  Include:
26
28
  - 'db/migrate/**/*.rb'
@@ -2,6 +2,6 @@
2
2
 
3
3
  module RuboCop
4
4
  module Oracle
5
- VERSION = '0.1.0'
5
+ VERSION = '0.2.0'
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubocop-oracle
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.2.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Koichi ITO
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2021-04-12 00:00:00.000000000 Z
11
+ date: 2021-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rubocop