rails_event_store_active_record 0.39.0 → 0.40.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/rails_event_store_active_record/generators/migration_generator.rb +22 -0
- data/lib/rails_event_store_active_record/generators/templates/create_event_store_events_template.rb +2 -2
- data/lib/rails_event_store_active_record/version.rb +1 -1
- data/rails_event_store_active_record.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8c77dd845f1236e3d0fc729cd3db85c0a3283728310e797900d850c860247529
|
4
|
+
data.tar.gz: ddf83f40d8efe5177755824b30db6f7734c24e2ac156c226b40a8edd869998c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 71f5e11f5e5aaa0a49f3780e1d01915b649bfe9888f5af01aa683b3b798296e2ce78d51e4344a1fb57300c98819f6777ff438f16afadc5c64448a928cc4ca2f4
|
7
|
+
data.tar.gz: 4991c1a558269da89a91b1f7e61ceea69548d457345c2a70e668b038c4cc13da62f84b1563f327e4964d370fb422e7f50eb145fd5d7da6567cdc4ce3938c0c97
|
@@ -5,7 +5,25 @@ end
|
|
5
5
|
|
6
6
|
module RailsEventStoreActiveRecord
|
7
7
|
class MigrationGenerator < Rails::Generators::Base
|
8
|
+
class Error < Thor::Error; end
|
9
|
+
|
10
|
+
DATA_TYPES = %w(binary json jsonb).freeze
|
11
|
+
|
8
12
|
source_root File.expand_path(File.join(File.dirname(__FILE__), '../generators/templates'))
|
13
|
+
class_option(
|
14
|
+
:data_type,
|
15
|
+
type: :string,
|
16
|
+
default: 'binary',
|
17
|
+
desc: "Configure the data type for `data` and `meta data` feilds in Postgres migration (options: #{DATA_TYPES.join('/')})"
|
18
|
+
)
|
19
|
+
|
20
|
+
def initialize(*args)
|
21
|
+
super
|
22
|
+
|
23
|
+
if DATA_TYPES.exclude?(options.fetch(:data_type))
|
24
|
+
raise Error, "Invalid value for --data-type option. Supported for options are: #{DATA_TYPES.join(", ")}."
|
25
|
+
end
|
26
|
+
end
|
9
27
|
|
10
28
|
def create_migration
|
11
29
|
template "create_event_store_events_template.rb", "db/migrate/#{timestamp}_create_event_store_events.rb"
|
@@ -13,6 +31,10 @@ module RailsEventStoreActiveRecord
|
|
13
31
|
|
14
32
|
private
|
15
33
|
|
34
|
+
def data_type
|
35
|
+
options.fetch('data_type')
|
36
|
+
end
|
37
|
+
|
16
38
|
def rails_version
|
17
39
|
Rails::VERSION::STRING
|
18
40
|
end
|
data/lib/rails_event_store_active_record/generators/templates/create_event_store_events_template.rb
CHANGED
@@ -21,8 +21,8 @@ class CreateEventStoreEvents < ActiveRecord::Migration<%= migration_version %>
|
|
21
21
|
if postgres
|
22
22
|
create_table(:event_store_events, id: :uuid, default: 'gen_random_uuid()', force: false) do |t|
|
23
23
|
t.string :event_type, null: false
|
24
|
-
t
|
25
|
-
t
|
24
|
+
t.<%= data_type %> :metadata
|
25
|
+
t.<%= data_type %> :data, null: false
|
26
26
|
t.datetime :created_at, null: false
|
27
27
|
end
|
28
28
|
else
|
@@ -25,7 +25,7 @@ Gem::Specification.new do |spec|
|
|
25
25
|
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
26
26
|
spec.require_paths = ['lib']
|
27
27
|
|
28
|
-
spec.add_dependency 'ruby_event_store', '= 0.
|
28
|
+
spec.add_dependency 'ruby_event_store', '= 0.40.0'
|
29
29
|
spec.add_dependency 'activesupport', '>= 3.0'
|
30
30
|
spec.add_dependency 'activemodel', '>= 3.0'
|
31
31
|
spec.add_dependency 'activerecord-import', '~> 0.26'
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_event_store_active_record
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.40.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Arkency
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-06-25 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: ruby_event_store
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - '='
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.40.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: 0.
|
26
|
+
version: 0.40.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activesupport
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -120,7 +120,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
120
120
|
- !ruby/object:Gem::Version
|
121
121
|
version: '0'
|
122
122
|
requirements: []
|
123
|
-
rubygems_version: 3.0.
|
123
|
+
rubygems_version: 3.0.1
|
124
124
|
signing_key:
|
125
125
|
specification_version: 4
|
126
126
|
summary: Active Record events repository for Rails Event Store
|