rubocop-oracle 0.1.0 → 0.2.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +6 -0
- data/README.md +28 -0
- data/config/default.yml +2 -0
- data/lib/rubocop/oracle/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4386eee3acd95655ca1eed299d20110d745f177d6d7e3c7583544c19f5d1d5e1
|
4
|
+
data.tar.gz: e0c8eab371f6a6d3c9bf915c581a42507596aea50e767ce4101a613469323b9a
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 248f4e8662943bee026bf35a02a97d3785e9081589d279f6e2331685830ece09f4cd59af73bea1821aa188ae7a03587b02335f8f85c3cc04e98c5b7be2feee95
|
7
|
+
data.tar.gz: ed9f6f5197432d7f96596293af50945dc0d226d1960dc1b9b635ae2227aef0d0e48eaec406eeb46070fbb28074073402d5ae14e577afab2a17210dba2000cf0d
|
data/CHANGELOG.md
CHANGED
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'
|
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.
|
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-
|
11
|
+
date: 2021-04-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rubocop
|