temporal_tables 0.8.0 → 0.8.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflow/test.yml +44 -0
- data/README.md +1 -1
- data/gemfiles/Gemfile.5.1.mysql.lock +1 -1
- data/gemfiles/Gemfile.5.1.pg.lock +1 -1
- data/gemfiles/Gemfile.5.2.mysql.lock +1 -1
- data/gemfiles/Gemfile.5.2.pg.lock +1 -1
- data/gemfiles/Gemfile.6.0.mysql.lock +1 -1
- data/gemfiles/Gemfile.6.0.pg.lock +1 -1
- data/lib/temporal_tables/temporal_adapter.rb +3 -7
- data/lib/temporal_tables/version.rb +1 -1
- metadata +2 -2
- data/CHANGELOG.md +0 -73
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ee8d4dcf1ea296b8fcfe3f85fc07009814c004bbe2dfbad704de6fe13fa148ed
|
4
|
+
data.tar.gz: 2a27e33796d5fd8186212ccd218b9467ada0bd7c7ad1efc905aa1a0ea6f47bc7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 36d790abd0bfc655a0a8fd76fe5845bab7a0871d83d7384ef5461cabf21282601ee75888aada656fdd77cef144244406f3e5568d68ebada8b14af5baf8fe76a1
|
7
|
+
data.tar.gz: 96a060054680df625c7fcb2399b42cf5944bb1f319b48a190a373f75b7b9d506d2038a5e34ecff55592e9e59c0bb540035d832c5a3f088a5c9097c3e1dc9eb20
|
@@ -0,0 +1,44 @@
|
|
1
|
+
on:
|
2
|
+
push:
|
3
|
+
branches:
|
4
|
+
- '**'
|
5
|
+
|
6
|
+
jobs:
|
7
|
+
build:
|
8
|
+
runs-on: ubuntu-latest
|
9
|
+
|
10
|
+
services:
|
11
|
+
postgres:
|
12
|
+
image: postgres:11.5
|
13
|
+
ports: ["5432:5432"]
|
14
|
+
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5
|
15
|
+
|
16
|
+
steps:
|
17
|
+
- uses: actions/checkout@v1
|
18
|
+
|
19
|
+
- name: Set up Ruby 2.5.4
|
20
|
+
uses: actions/setup-ruby@v1
|
21
|
+
with:
|
22
|
+
ruby-version: 2.5.4
|
23
|
+
|
24
|
+
- name: Install PostgreSQL 11 client
|
25
|
+
run: |
|
26
|
+
sudo apt-get -yqq install libpq-dev
|
27
|
+
|
28
|
+
- name: Build App
|
29
|
+
env:
|
30
|
+
PGHOST: localhost
|
31
|
+
PGUSER: postgres
|
32
|
+
RAILS_ENV: test
|
33
|
+
run: |
|
34
|
+
gem install bundler
|
35
|
+
bundle install --jobs 4 --retry 3
|
36
|
+
bin/rails db:setup
|
37
|
+
|
38
|
+
- name: Run Tests
|
39
|
+
env:
|
40
|
+
PGHOST: localhost
|
41
|
+
PGUSER: postgres
|
42
|
+
RAILS_ENV: test
|
43
|
+
run: |
|
44
|
+
bundle exec rspec
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
|
3
3
|
Easily recall what your data looked like at any point in the past! TemporalTables sets up and maintains history tables to track all temporal changes to to your data.
|
4
4
|
|
5
|
-
Currently tested on Ruby 2.5.4, Rails 5.1 - 6.
|
5
|
+
Currently tested on Ruby 2.5.4, Rails 5.1 - 6.0, Postgres 11.3, MySQL 8.0.13
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
@@ -26,10 +26,10 @@ module TemporalTables
|
|
26
26
|
end
|
27
27
|
|
28
28
|
def add_temporal_table(table_name, options = {})
|
29
|
-
id = id_column(table_name)
|
30
|
-
|
31
29
|
create_table temporal_name(table_name), options.merge(id: false, primary_key: "history_id", temporal_bypass: true) do |t|
|
32
|
-
|
30
|
+
if options[:id] != false
|
31
|
+
t.column :id, options.fetch(:id, :integer)
|
32
|
+
end
|
33
33
|
t.datetime :eff_from, null: false, limit: 6
|
34
34
|
t.datetime :eff_to, null: false, limit: 6, default: "9999-12-31"
|
35
35
|
|
@@ -186,9 +186,5 @@ module TemporalTables
|
|
186
186
|
raise "Rails version not supported"
|
187
187
|
end
|
188
188
|
end
|
189
|
-
|
190
|
-
def id_column(table_name)
|
191
|
-
columns(table_name).detect { |c| c.name == "id" }
|
192
|
-
end
|
193
189
|
end
|
194
190
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: temporal_tables
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.8.
|
4
|
+
version: 0.8.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Brent Kroeker
|
@@ -81,10 +81,10 @@ extensions: []
|
|
81
81
|
extra_rdoc_files: []
|
82
82
|
files:
|
83
83
|
- ".editorconfig"
|
84
|
+
- ".github/workflow/test.yml"
|
84
85
|
- ".gitignore"
|
85
86
|
- ".ruby-version"
|
86
87
|
- ".travis.yml"
|
87
|
-
- CHANGELOG.md
|
88
88
|
- Gemfile
|
89
89
|
- LICENSE.txt
|
90
90
|
- README.md
|
data/CHANGELOG.md
DELETED
@@ -1,73 +0,0 @@
|
|
1
|
-
# CHANGELOG
|
2
|
-
|
3
|
-
## 0.4.0 (2016-12-13)
|
4
|
-
|
5
|
-
* added multi-environment spec framework
|
6
|
-
* bug fix: mysql2 gem should now be functional
|
7
|
-
|
8
|
-
## 0.3.1 (2015-10-08)
|
9
|
-
|
10
|
-
* bug fix: accepts reserved keywords for postgres column names, like "default"
|
11
|
-
* bug fix: correctly handles models nested within modules
|
12
|
-
|
13
|
-
## 0.3.0 (2014-07-04)
|
14
|
-
|
15
|
-
* Updated for Rails 4
|
16
|
-
|
17
|
-
## 0.2.7 (2013-07-10)
|
18
|
-
|
19
|
-
* bug fix: fix problems with STI instantiation
|
20
|
-
|
21
|
-
## 0.2.6 (2013-05-23)
|
22
|
-
|
23
|
-
* bug fix: explicitly set sti_name on history classes of STI subclasses
|
24
|
-
|
25
|
-
## 0.2.5 (2013-04-24)
|
26
|
-
|
27
|
-
* bug fix: rename_column wasn't linked in correctly
|
28
|
-
|
29
|
-
## 0.2.4 (2013-03-07)
|
30
|
-
|
31
|
-
* bug fix: another fix for removing indexes
|
32
|
-
|
33
|
-
# 0.2.3 (2013-02-25)
|
34
|
-
|
35
|
-
* bug fix: history classes did not have the correct primary key set, which could provide unexpected results in certain use cases
|
36
|
-
* added a history method to ActiveRecord::Base objects to return a sorted list of all historical versions of that object.
|
37
|
-
* added prev and next methods to history objects to aid in traversing the historical versions of an object.
|
38
|
-
* added orig_obj method to history objects to return their non-historical objects
|
39
|
-
|
40
|
-
## 0.2.2 (2013-02-25)
|
41
|
-
|
42
|
-
* bug fix: add_index with specified name caused an index collision
|
43
|
-
|
44
|
-
## 0.2.1 (2013-02-21)
|
45
|
-
|
46
|
-
* bug fix: removing indexes didn't work
|
47
|
-
|
48
|
-
## 0.2.0 (2013-02-21)
|
49
|
-
|
50
|
-
* added support for indexes
|
51
|
-
|
52
|
-
## 0.1.0 (2013-01-10)
|
53
|
-
|
54
|
-
* added history querying
|
55
|
-
|
56
|
-
## 0.0.6 (2012-11-29)
|
57
|
-
|
58
|
-
* optimized the history table index
|
59
|
-
|
60
|
-
## 0.0.5 (2012-11-29)
|
61
|
-
|
62
|
-
* added indexes to history tables
|
63
|
-
|
64
|
-
## 0.0.4 (2012-10-19)
|
65
|
-
|
66
|
-
* added updated_by support
|
67
|
-
* added some configuration options
|
68
|
-
|
69
|
-
## 0.0.2 (2012-10-12)
|
70
|
-
|
71
|
-
* added support for rename_table
|
72
|
-
* added add_temporal_table(table_name) method
|
73
|
-
* added remove_temporal_table(table_name) method
|