logidze 0.12.0 → 1.0.0.rc1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (58) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +29 -5
  3. data/LICENSE.txt +1 -1
  4. data/README.md +263 -103
  5. data/lib/generators/logidze/fx_helper.rb +17 -0
  6. data/lib/generators/logidze/inject_sql.rb +18 -0
  7. data/lib/generators/logidze/install/USAGE +6 -1
  8. data/lib/generators/logidze/install/functions/logidze_compact_history.sql +38 -0
  9. data/lib/generators/logidze/install/functions/logidze_filter_keys.sql +27 -0
  10. data/lib/generators/logidze/install/functions/logidze_logger.sql +150 -0
  11. data/lib/generators/logidze/install/functions/logidze_snapshot.sql +24 -0
  12. data/lib/generators/logidze/install/functions/logidze_version.sql +20 -0
  13. data/lib/generators/logidze/install/install_generator.rb +58 -1
  14. data/lib/generators/logidze/install/templates/hstore.rb.erb +1 -1
  15. data/lib/generators/logidze/install/templates/migration.rb.erb +19 -232
  16. data/lib/generators/logidze/install/templates/migration_fx.rb.erb +41 -0
  17. data/lib/generators/logidze/model/model_generator.rb +49 -13
  18. data/lib/generators/logidze/model/templates/migration.rb.erb +57 -36
  19. data/lib/generators/logidze/model/triggers/logidze.sql +6 -0
  20. data/lib/logidze.rb +27 -14
  21. data/lib/logidze/history.rb +1 -10
  22. data/lib/logidze/ignore_log_data.rb +1 -4
  23. data/lib/logidze/model.rb +48 -35
  24. data/lib/logidze/version.rb +1 -1
  25. metadata +48 -73
  26. data/.gitattributes +0 -3
  27. data/.github/ISSUE_TEMPLATE.md +0 -20
  28. data/.github/PULL_REQUEST_TEMPLATE.md +0 -29
  29. data/.gitignore +0 -40
  30. data/.rubocop.yml +0 -55
  31. data/.travis.yml +0 -46
  32. data/Gemfile +0 -15
  33. data/Rakefile +0 -28
  34. data/assets/pg_log_data_chart.png +0 -0
  35. data/bench/performance/README.md +0 -109
  36. data/bench/performance/diff_bench.rb +0 -38
  37. data/bench/performance/insert_bench.rb +0 -22
  38. data/bench/performance/memory_profile.rb +0 -56
  39. data/bench/performance/setup.rb +0 -315
  40. data/bench/performance/update_bench.rb +0 -38
  41. data/bench/triggers/Makefile +0 -56
  42. data/bench/triggers/Readme.md +0 -58
  43. data/bench/triggers/bench.sql +0 -6
  44. data/bench/triggers/hstore_trigger_setup.sql +0 -38
  45. data/bench/triggers/jsonb_minus_2_setup.sql +0 -47
  46. data/bench/triggers/jsonb_minus_setup.sql +0 -49
  47. data/bench/triggers/keys2_trigger_setup.sql +0 -44
  48. data/bench/triggers/keys_trigger_setup.sql +0 -50
  49. data/bin/console +0 -8
  50. data/bin/setup +0 -9
  51. data/gemfiles/rails42.gemfile +0 -6
  52. data/gemfiles/rails5.gemfile +0 -6
  53. data/gemfiles/rails52.gemfile +0 -6
  54. data/gemfiles/rails6.gemfile +0 -6
  55. data/gemfiles/railsmaster.gemfile +0 -7
  56. data/lib/logidze/ignore_log_data/ignored_columns.rb +0 -46
  57. data/lib/logidze/migration.rb +0 -20
  58. data/logidze.gemspec +0 -41
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Logidze
4
- VERSION = "0.12.0"
4
+ VERSION = "1.0.0.rc1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logidze
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 1.0.0.rc1
5
5
  platform: ruby
6
6
  authors:
7
7
  - palkan
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-02 00:00:00.000000000 Z
11
+ date: 2020-09-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -16,112 +16,112 @@ dependencies:
16
16
  requirements:
17
17
  - - ">="
18
18
  - !ruby/object:Gem::Version
19
- version: '4.2'
19
+ version: '5.0'
20
20
  type: :runtime
21
21
  prerelease: false
22
22
  version_requirements: !ruby/object:Gem::Requirement
23
23
  requirements:
24
24
  - - ">="
25
25
  - !ruby/object:Gem::Version
26
- version: '4.2'
26
+ version: '5.0'
27
27
  - !ruby/object:Gem::Dependency
28
- name: ammeter
28
+ name: ruby-next-core
29
29
  requirement: !ruby/object:Gem::Requirement
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: 1.1.3
34
- type: :development
33
+ version: '0.9'
34
+ type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: 1.1.3
40
+ version: '0.9'
41
41
  - !ruby/object:Gem::Dependency
42
- name: bundler
42
+ name: ammeter
43
43
  requirement: !ruby/object:Gem::Requirement
44
44
  requirements:
45
- - - ">="
45
+ - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '1.10'
47
+ version: 1.1.3
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
- - - ">="
52
+ - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '1.10'
54
+ version: 1.1.3
55
55
  - !ruby/object:Gem::Dependency
56
- name: pg
56
+ name: bundler
57
57
  requirement: !ruby/object:Gem::Requirement
58
58
  requirements:
59
59
  - - ">="
60
60
  - !ruby/object:Gem::Version
61
- version: '0.18'
61
+ version: '1.10'
62
62
  type: :development
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - ">="
67
67
  - !ruby/object:Gem::Version
68
- version: '0.18'
68
+ version: '1.10'
69
69
  - !ruby/object:Gem::Dependency
70
- name: rake
70
+ name: fx
71
71
  requirement: !ruby/object:Gem::Requirement
72
72
  requirements:
73
- - - ">="
73
+ - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: '10.0'
75
+ version: '0.5'
76
76
  type: :development
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
- - - ">="
80
+ - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: '10.0'
82
+ version: '0.5'
83
83
  - !ruby/object:Gem::Dependency
84
- name: rspec-rails
84
+ name: pg
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - ">="
88
88
  - !ruby/object:Gem::Version
89
- version: '3.4'
89
+ version: '0.18'
90
90
  type: :development
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
- version: '3.4'
96
+ version: '0.18'
97
97
  - !ruby/object:Gem::Dependency
98
- name: rubocop-md
98
+ name: rake
99
99
  requirement: !ruby/object:Gem::Requirement
100
100
  requirements:
101
- - - "~>"
101
+ - - ">="
102
102
  - !ruby/object:Gem::Version
103
- version: 0.2.0
103
+ version: '13.0'
104
104
  type: :development
105
105
  prerelease: false
106
106
  version_requirements: !ruby/object:Gem::Requirement
107
107
  requirements:
108
- - - "~>"
108
+ - - ">="
109
109
  - !ruby/object:Gem::Version
110
- version: 0.2.0
110
+ version: '13.0'
111
111
  - !ruby/object:Gem::Dependency
112
- name: standard
112
+ name: rspec-rails
113
113
  requirement: !ruby/object:Gem::Requirement
114
114
  requirements:
115
- - - "~>"
115
+ - - ">="
116
116
  - !ruby/object:Gem::Version
117
- version: 0.1.2
117
+ version: '3.4'
118
118
  type: :development
119
119
  prerelease: false
120
120
  version_requirements: !ruby/object:Gem::Requirement
121
121
  requirements:
122
- - - "~>"
122
+ - - ">="
123
123
  - !ruby/object:Gem::Version
124
- version: 0.1.2
124
+ version: '3.4'
125
125
  - !ruby/object:Gem::Dependency
126
126
  name: timecop
127
127
  requirement: !ruby/object:Gem::Requirement
@@ -136,54 +136,32 @@ dependencies:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0.8'
139
- description: PostgreSQL JSON-based auditing
139
+ description: PostgreSQL JSONB-based model changes tracking
140
140
  email:
141
141
  - dementiev.vm@gmail.com
142
142
  executables: []
143
143
  extensions: []
144
144
  extra_rdoc_files: []
145
145
  files:
146
- - ".gitattributes"
147
- - ".github/ISSUE_TEMPLATE.md"
148
- - ".github/PULL_REQUEST_TEMPLATE.md"
149
- - ".gitignore"
150
- - ".rspec"
151
- - ".rubocop.yml"
152
- - ".travis.yml"
153
146
  - CHANGELOG.md
154
- - Gemfile
155
147
  - LICENSE.txt
156
148
  - README.md
157
- - Rakefile
158
- - assets/pg_log_data_chart.png
159
- - bench/performance/README.md
160
- - bench/performance/diff_bench.rb
161
- - bench/performance/insert_bench.rb
162
- - bench/performance/memory_profile.rb
163
- - bench/performance/setup.rb
164
- - bench/performance/update_bench.rb
165
- - bench/triggers/Makefile
166
- - bench/triggers/Readme.md
167
- - bench/triggers/bench.sql
168
- - bench/triggers/hstore_trigger_setup.sql
169
- - bench/triggers/jsonb_minus_2_setup.sql
170
- - bench/triggers/jsonb_minus_setup.sql
171
- - bench/triggers/keys2_trigger_setup.sql
172
- - bench/triggers/keys_trigger_setup.sql
173
- - bin/console
174
- - bin/setup
175
- - gemfiles/rails42.gemfile
176
- - gemfiles/rails5.gemfile
177
- - gemfiles/rails52.gemfile
178
- - gemfiles/rails6.gemfile
179
- - gemfiles/railsmaster.gemfile
149
+ - lib/generators/logidze/fx_helper.rb
150
+ - lib/generators/logidze/inject_sql.rb
180
151
  - lib/generators/logidze/install/USAGE
152
+ - lib/generators/logidze/install/functions/logidze_compact_history.sql
153
+ - lib/generators/logidze/install/functions/logidze_filter_keys.sql
154
+ - lib/generators/logidze/install/functions/logidze_logger.sql
155
+ - lib/generators/logidze/install/functions/logidze_snapshot.sql
156
+ - lib/generators/logidze/install/functions/logidze_version.sql
181
157
  - lib/generators/logidze/install/install_generator.rb
182
158
  - lib/generators/logidze/install/templates/hstore.rb.erb
183
159
  - lib/generators/logidze/install/templates/migration.rb.erb
160
+ - lib/generators/logidze/install/templates/migration_fx.rb.erb
184
161
  - lib/generators/logidze/model/USAGE
185
162
  - lib/generators/logidze/model/model_generator.rb
186
163
  - lib/generators/logidze/model/templates/migration.rb.erb
164
+ - lib/generators/logidze/model/triggers/logidze.sql
187
165
  - lib/logidze.rb
188
166
  - lib/logidze/engine.rb
189
167
  - lib/logidze/has_logidze.rb
@@ -192,13 +170,10 @@ files:
192
170
  - lib/logidze/history/version.rb
193
171
  - lib/logidze/ignore_log_data.rb
194
172
  - lib/logidze/ignore_log_data/cast_attribute_patch.rb
195
- - lib/logidze/ignore_log_data/ignored_columns.rb
196
173
  - lib/logidze/meta.rb
197
- - lib/logidze/migration.rb
198
174
  - lib/logidze/model.rb
199
175
  - lib/logidze/version.rb
200
176
  - lib/logidze/versioned_association.rb
201
- - logidze.gemspec
202
177
  homepage: http://github.com/palkan/logidze
203
178
  licenses:
204
179
  - MIT
@@ -216,15 +191,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
216
191
  requirements:
217
192
  - - ">="
218
193
  - !ruby/object:Gem::Version
219
- version: 2.4.0
194
+ version: 2.5.0
220
195
  required_rubygems_version: !ruby/object:Gem::Requirement
221
196
  requirements:
222
- - - ">="
197
+ - - ">"
223
198
  - !ruby/object:Gem::Version
224
- version: '0'
199
+ version: 1.3.1
225
200
  requirements: []
226
201
  rubygems_version: 3.0.6
227
202
  signing_key:
228
203
  specification_version: 4
229
- summary: PostgreSQL JSON-based auditing
204
+ summary: PostgreSQL JSONB-based model changes tracking
230
205
  test_files: []
@@ -1,3 +0,0 @@
1
- assets/**/* linguist-vendored
2
- bench/**/* linguist-vendored
3
- .github/**/* linguist-vendored
@@ -1,20 +0,0 @@
1
- <!--
2
- This template is for bug reports. If you are reporting a bug, please continue on. If you are here for another reason,
3
- feel free to skip the rest of this template.
4
- -->
5
-
6
- ### Tell us about your environment
7
-
8
- **Ruby Version:**
9
-
10
- **Rails Version:**
11
-
12
- **PostgreSQL Version:**
13
-
14
- **Logidze Version:**
15
-
16
- ### What did you do?
17
-
18
- ### What did you expect to happen?
19
-
20
- ### What actually happened?
@@ -1,29 +0,0 @@
1
- <!--
2
- First of all, thanks for contributing!
3
-
4
- If it's a typo fix or minor documentation update feel free to skip the rest of this template!
5
- -->
6
-
7
- <!--
8
- If it's a bug fix, then link it to the issue, for example:
9
-
10
- Fixes #xxx
11
- -->
12
-
13
-
14
- <!--
15
- Otherwise, describe the changes:
16
-
17
- ### What is the purpose of this pull request?
18
-
19
- ### What changes did you make? (overview)
20
-
21
- ### Is there anything you'd like reviewers to focus on?
22
-
23
- ### Checklist
24
-
25
- - [ ] I've added tests for this change
26
- - [ ] I've added a Changelog entry
27
- - [ ] I've updated a documentation (Readme)
28
-
29
- -->
data/.gitignore DELETED
@@ -1,40 +0,0 @@
1
- # Numerous always-ignore extensions
2
- *.diff
3
- *.err
4
- *.orig
5
- *.log
6
- *.rej
7
- *.swo
8
- *.swp
9
- *.vi
10
- *~
11
- *.sass-cache
12
- *.iml
13
- .idea/
14
-
15
- # Sublime
16
- *.sublime-project
17
- *.sublime-workspace
18
-
19
- # OS or Editor folders
20
- .DS_Store
21
- .cache
22
- .project
23
- .settings
24
- .tmproj
25
- Thumbs.db
26
-
27
- .bundle/
28
- log/*.log
29
- *.gz
30
- pkg/
31
- spec/dummy/db/*.sqlite3
32
- spec/dummy/db/*.sqlite3-journal
33
- spec/dummy/tmp/
34
-
35
- Gemfile.lock
36
- Gemfile.local
37
- .rspec
38
- *.gem
39
- tmp/
40
- coverage/
@@ -1,55 +0,0 @@
1
- require:
2
- - standard/cop/semantic_blocks
3
- - rubocop-md
4
-
5
- inherit_gem:
6
- standard: config/base.yml
7
-
8
- AllCops:
9
- Exclude:
10
- - 'bin/*'
11
- - 'tmp/**/*'
12
- - 'docs/**/*'
13
- - 'Gemfile'
14
- - 'vendor/**/*'
15
- - 'gemfiles/**/*'
16
- DisplayCopNames: true
17
- TargetRubyVersion: 2.4
18
-
19
- Standard/SemanticBlocks:
20
- Enabled: false
21
-
22
- Style/FrozenStringLiteralComment:
23
- Enabled: true
24
-
25
- Style/TrailingCommaInArrayLiteral:
26
- EnforcedStyleForMultiline: no_comma
27
-
28
- Style/TrailingCommaInHashLiteral:
29
- EnforcedStyleForMultiline: no_comma
30
-
31
- Layout/ParameterAlignment:
32
- EnforcedStyle: with_first_parameter
33
-
34
- Lint/Void:
35
- Exclude:
36
- - '**/*.md'
37
-
38
- # See https://github.com/rubocop-hq/rubocop/issues/4222
39
- Lint/AmbiguousBlockAssociation:
40
- Exclude:
41
- - 'spec/**/*'
42
- - '**/*.md'
43
-
44
- Lint/DuplicateMethods:
45
- Exclude:
46
- - '**/*.md'
47
-
48
- Naming/FileName:
49
- Exclude:
50
- - 'lib/test-prof.rb'
51
- - '**/*.md'
52
-
53
- Layout/InitialIndentation:
54
- Exclude:
55
- - 'CHANGELOG.md'
@@ -1,46 +0,0 @@
1
- language: ruby
2
- cache: bundler
3
-
4
- dist: trusty
5
- sudo: false
6
-
7
- notifications:
8
- email: false
9
-
10
- addons:
11
- postgresql: "9.6"
12
-
13
- env:
14
- global:
15
- - LOGIDZE_DB_USER=postgres
16
- - LOGIDZE_DB_NAME=logidze
17
-
18
- before_script:
19
- - gem update --system
20
- - bundle exec rake dummy:db:create
21
- - psql -U postgres -d logidze -c 'CREATE EXTENSION IF NOT EXISTS hstore;'
22
- - RAILS_ENV=test bundle exec rake dummy:db:create dummy:db:migrate
23
-
24
- before_install:
25
- - gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
26
- - gem install bundler -v '< 2'
27
-
28
- matrix:
29
- include:
30
- - rvm: ruby-head
31
- gemfile: gemfiles/railsmaster.gemfile
32
- - rvm: 2.7
33
- gemfile: gemfiles/rails6.gemfile
34
- - rvm: 2.6
35
- gemfile: gemfiles/rails5.gemfile
36
- - rvm: 2.5
37
- gemfile: gemfiles/rails52.gemfile
38
- - rvm: 2.4
39
- gemfile: gemfiles/rails5.gemfile
40
- - rvm: 2.4
41
- gemfile: gemfiles/rails42.gemfile
42
- allow_failures:
43
- - rvm: ruby-head
44
- gemfile: gemfiles/railsmaster.gemfile
45
- - rvm: 2.5
46
- gemfile: gemfiles/railsmaster.gemfile