active_snapshot 0.3.1 → 0.3.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ae65e9cfd6d45c8c60d4766bf54e54c9c79692dde454a99c0b6eb4acc67878f7
4
- data.tar.gz: aae883536807c9f8469c6b19792e509299538c942f985d8e1dbdf7afbf45e012
3
+ metadata.gz: ffb14fbf0391e0fb8c91c363740372b0e9688711ed41e620fd1707c690562cb5
4
+ data.tar.gz: 60c00ff5bd2266bfebc2411945f4f6b8cb9f1435ef9b012a582fffbf2e10b73c
5
5
  SHA512:
6
- metadata.gz: 62e07d7c2d1168428b7e043a988a86eb4ab1602654a751cad9d6892b53d2d76ffa68f873c9184441d5c0fa9188395876047af17cce1aea76322f8fe8e1b65135
7
- data.tar.gz: 0ed2fd20a0c5f183e398108923a168ad57bc467142962875e3257336dfbb432f3e8097136f39c6d54cc01b4ae42967d91f075f50b3b8cba8af57c30f77d89d60
6
+ metadata.gz: 729687b8c87777eeb8d2dd923b67917ae9000fe73d604517ecdb2410361d659c437bbe9c491c89927942540edf2fc12cdab8ca51cc7c4e3c9dfd1443e2a2b669
7
+ data.tar.gz: 25690387b0d2ec4ee5f951579c038e4cddedbd9f5ba3bf3aaafdfe8eeace856004203ffb940fc5581baf0ee31993168a78502774cb36173e85900bb9428e1ff4
data/CHANGELOG.md CHANGED
@@ -2,9 +2,13 @@ CHANGELOG
2
2
  ---------
3
3
 
4
4
  - **Unreleased**
5
- * [View Diff](https://github.com/westonganger/active_snapshot/compare/v0.3.1...master)
5
+ * [View Diff](https://github.com/westonganger/active_snapshot/compare/v0.3.2...master)
6
6
  * Nothing yet
7
7
 
8
+ - **v0.3.2** - Oct 17, 2023
9
+ * [View Diff](https://github.com/westonganger/active_snapshot/compare/v0.3.1...v0.3.2)
10
+ * [#43](https://github.com/westonganger/active_snapshot/pull/43) - Fix unique index error in generated DB migration
11
+
8
12
  - **v0.3.1** - August 4, 2023
9
13
  * [View Diff](https://github.com/westonganger/active_snapshot/compare/v0.3.0...v0.3.1)
10
14
  * [#36](https://github.com/westonganger/active_snapshot/pull/36) - Allow ActiveRecord to be lazy loaded using `ActiveSupport.on_load`
@@ -1,3 +1,3 @@
1
1
  module ActiveSnapshot
2
- VERSION = "0.3.1".freeze
2
+ VERSION = "0.3.2".freeze
3
3
  end
@@ -3,16 +3,23 @@ class <%= migration_name %> < ActiveRecord::Migration::Current
3
3
  def change
4
4
  create_table :snapshots<%= table_options %> do |t|
5
5
  t.belongs_to :item, polymorphic: true, null: false, index: true
6
- t.string :identifier, unique: [:item_id, :item_type], index: true
7
6
  t.belongs_to :user, polymorphic: true
7
+
8
+ t.string :identifier, index: true
9
+ t.index [:identifier, :item_id, :item_type], unique: true
10
+
8
11
  t.<%= ActiveSnapshot.config.storage_method == 'native_json' ? 'json' : 'text' %> :metadata
12
+
9
13
  t.datetime :created_at, null: false
10
14
  end
11
15
 
12
16
  create_table :snapshot_items<%= table_options %> do |t|
13
17
  t.belongs_to :snapshot, null: false, index: true
14
- t.belongs_to :item, polymorphic: true, null: false, unique: [:snapshot_id], index: true
18
+ t.belongs_to :item, polymorphic: true, null: false, index: true
19
+ t.index [:snapshot_id, :item_id, :item_type], unique: true
20
+
15
21
  t.<%= ActiveSnapshot.config.storage_method == 'native_json' ? 'json' : 'text' %> :object, null: false
22
+
16
23
  t.datetime :created_at, null: false
17
24
  t.string :child_group_name
18
25
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_snapshot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Weston Ganger
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-08-04 00:00:00.000000000 Z
11
+ date: 2023-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -170,7 +170,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
170
170
  requirements:
171
171
  - - ">="
172
172
  - !ruby/object:Gem::Version
173
- version: 2.3.0
173
+ version: '0'
174
174
  required_rubygems_version: !ruby/object:Gem::Requirement
175
175
  requirements:
176
176
  - - ">="