logidze 1.0.0.rc1 → 1.0.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 +4 -2
- data/README.md +10 -4
- data/lib/generators/logidze/model/model_generator.rb +4 -0
- data/lib/logidze/model.rb +2 -8
- data/lib/logidze/version.rb +1 -1
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c273494bd5a85f1f9d967a8fb474bc8ef4df75d42bf756a96f4a83e6cc9ed1a2
|
4
|
+
data.tar.gz: da791cced5e41ff2025ba349d16b394f6398a06b22782a5e78b7be1f18edbb48
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30e03d1adf876881e88e630774963d3a347b3c3114a2e345177d9c6b6480bab9bfd76d572fe681dd5a9b006cd2c212ed07e1a340fbc0a9275df48c6da0d11553
|
7
|
+
data.tar.gz: 52663d375ac840f39d783eb2441b104b9ab910d3ee93d8ca309be9d9be626396caa6d9daac72d348e0d225945f37948bb197f18928bc865a9d2114735520cecb
|
data/CHANGELOG.md
CHANGED
@@ -1,8 +1,10 @@
|
|
1
1
|
# Change log
|
2
2
|
|
3
|
-
##
|
3
|
+
## 1.0.0 (2020-11-09)
|
4
4
|
|
5
|
-
|
5
|
+
- Add `--name` option to model generator to specify the migration name. ([@palkan][])
|
6
|
+
|
7
|
+
When you update Logidze installation for a model multiple times, you might hit the `DuplicateMigrationNameError` (see [#167](https://github.com/palkan/logidze/issues/167)).
|
6
8
|
|
7
9
|
- Add `.with_full_snapshot` to add full snapshots to the log instead of diffs. ([@palkan][])
|
8
10
|
|
data/README.md
CHANGED
@@ -10,8 +10,6 @@ Logidze provides tools for logging DB records changes when using PostgreSQL (>=9
|
|
10
10
|
Logidze allows you to create a DB-level log (using triggers) and gives you an API to browse this log.
|
11
11
|
The log is stored with the record itself in JSONB column. No additional tables required.
|
12
12
|
|
13
|
-
**❗️ IMPORTANT:** This page contains documentation for the upcoming v1.0. For the latest release documentation see the [0-stable branch](https://github.com/palkan/logidze/tree/0-stable). If you're just starting with Logidze, we recommend using the latest release candidate (`1.0.0.rc1`).
|
14
|
-
|
15
13
|
🤔 [How is Logidze pronounced?](https://github.com/palkan/logidze/issues/73)
|
16
14
|
|
17
15
|
Other requirements:
|
@@ -31,7 +29,7 @@ Other requirements:
|
|
31
29
|
- [Main concepts](#main-concepts)
|
32
30
|
- [Installation & Configuration](#installation)
|
33
31
|
- [Using with schema.rb](#using-with-schemarb)
|
34
|
-
- [
|
32
|
+
- [Configuring models](#configuring-models)
|
35
33
|
- [Backfill data](#backfill-data)
|
36
34
|
- [Log size limit](#log-size-limit)
|
37
35
|
- [Tracking only selected columns](#tracking-only-selected-columns)
|
@@ -56,7 +54,7 @@ Other requirements:
|
|
56
54
|
Add Logidze to your application's Gemfile:
|
57
55
|
|
58
56
|
```ruby
|
59
|
-
gem "logidze", "1.0.0
|
57
|
+
gem "logidze", "~> 1.0.0"
|
60
58
|
```
|
61
59
|
|
62
60
|
Install required DB extensions and create trigger function:
|
@@ -454,6 +452,14 @@ If you want to update Logidze settings for the model, run migration with `--upda
|
|
454
452
|
rails generate logidze:model Post --update --only=title,body,rating
|
455
453
|
```
|
456
454
|
|
455
|
+
You can also use the `--name` option to specify the migration name to avoid duplicate migration names:
|
456
|
+
|
457
|
+
```sh
|
458
|
+
$ rails generate logidze:model Post --update --only=title,body,rating --name add_only_filter_to_posts_log_data
|
459
|
+
|
460
|
+
create db/migrate/20202309142344_add_only_filter_to_posts_log_data.rb
|
461
|
+
```
|
462
|
+
|
457
463
|
### Upgrading from 0.x to 1.0 (edge)
|
458
464
|
|
459
465
|
#### Schema and migrations
|
@@ -35,6 +35,8 @@ module Logidze
|
|
35
35
|
class_option :timestamp_column, type: :string, optional: true,
|
36
36
|
desc: "Specify timestamp column"
|
37
37
|
|
38
|
+
class_option :name, type: :string, optional: true, desc: "Migration name"
|
39
|
+
|
38
40
|
class_option :update, type: :boolean, optional: true,
|
39
41
|
desc: "Define whether this is an update migration"
|
40
42
|
|
@@ -62,6 +64,8 @@ module Logidze
|
|
62
64
|
|
63
65
|
no_tasks do
|
64
66
|
def migration_name
|
67
|
+
return options[:name] if options[:name].present?
|
68
|
+
|
65
69
|
if update?
|
66
70
|
"update_logidze_for_#{plural_table_name}"
|
67
71
|
else
|
data/lib/logidze/model.rb
CHANGED
@@ -253,14 +253,8 @@ module Logidze
|
|
253
253
|
object_at
|
254
254
|
end
|
255
255
|
|
256
|
-
|
257
|
-
|
258
|
-
@attributes[column].type.type_cast_from_database(value)
|
259
|
-
end
|
260
|
-
else
|
261
|
-
def deserialize_value(column, value)
|
262
|
-
@attributes[column].type.deserialize(value)
|
263
|
-
end
|
256
|
+
def deserialize_value(column, value)
|
257
|
+
@attributes[column].type.deserialize(value)
|
264
258
|
end
|
265
259
|
|
266
260
|
def deleted_column?(column)
|
data/lib/logidze/version.rb
CHANGED
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: 1.0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- palkan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-09
|
11
|
+
date: 2020-11-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails
|
@@ -194,9 +194,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
194
194
|
version: 2.5.0
|
195
195
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
196
196
|
requirements:
|
197
|
-
- - "
|
197
|
+
- - ">="
|
198
198
|
- !ruby/object:Gem::Version
|
199
|
-
version:
|
199
|
+
version: '0'
|
200
200
|
requirements: []
|
201
201
|
rubygems_version: 3.0.6
|
202
202
|
signing_key:
|