hairtrigger 0.2.25 → 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/lib/hair_trigger/version.rb +1 -1
- data/lib/hair_trigger.rb +16 -13
- metadata +9 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: d99ce209cb3572d2bcc2987758e5887b203f3fdf50ef295b18169a9f030d0d3a
|
4
|
+
data.tar.gz: 8e79c7bf238ebb1339bdefce635eb47050d509faad270c4af88d39a7ba89a8a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ffee9a6cac525abb8d0d7e49ec3f78877b54cdbfcaa77a2e2c5b6ac86d4b87401e02f0b54da8a62ebd8029d35ad7d0e798cdbcae34c9db429a4dea5d05aa8e51
|
7
|
+
data.tar.gz: d0c6a189591d1e0722fcbd72b51392efacd222734ae7da513f2f8da651f9c9ed5cf035174d6af04cb1206913873329cf3d8ec645d722810df86889030586ab96
|
data/lib/hair_trigger/version.rb
CHANGED
data/lib/hair_trigger.rb
CHANGED
@@ -39,19 +39,14 @@ module HairTrigger
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def migrator
|
42
|
-
|
43
|
-
|
42
|
+
if ActiveRecord::VERSION::STRING >= "7.1."
|
43
|
+
connection = ActiveRecord::Tasks::DatabaseTasks.migration_connection
|
44
|
+
schema_migration = connection.schema_migration
|
45
|
+
migrations = ActiveRecord::MigrationContext.new(migration_path, schema_migration).migrations
|
46
|
+
ActiveRecord::Migrator.new(:up, migrations, schema_migration, ActiveRecord::InternalMetadata.new(connection))
|
47
|
+
else
|
44
48
|
migrations = ActiveRecord::MigrationContext.new(migration_path, ActiveRecord::SchemaMigration).migrations
|
45
|
-
elsif version >= "5.2."
|
46
|
-
migrations = ActiveRecord::MigrationContext.new(migration_path).migrations
|
47
|
-
else # version >= "4.0."
|
48
|
-
migrations = ActiveRecord::Migrator.migrations(migration_path)
|
49
|
-
end
|
50
|
-
|
51
|
-
if version >= "6.0."
|
52
49
|
ActiveRecord::Migrator.new(:up, migrations, ActiveRecord::SchemaMigration)
|
53
|
-
else
|
54
|
-
ActiveRecord::Migrator.new(:up, migrations)
|
55
50
|
end
|
56
51
|
end
|
57
52
|
|
@@ -82,7 +77,7 @@ module HairTrigger
|
|
82
77
|
if previous_schema = (options.has_key?(:previous_schema) ? options[:previous_schema] : File.exist?(schema_rb_path) && File.read(schema_rb_path))
|
83
78
|
base_triggers = MigrationReader.get_triggers(previous_schema, options)
|
84
79
|
unless base_triggers.empty?
|
85
|
-
version = (previous_schema =~ /ActiveRecord::Schema
|
80
|
+
version = (previous_schema =~ /ActiveRecord::Schema(\[\d\.\d\])?\.define\(version\: (.*)\)/) && $2.to_i
|
86
81
|
migrations.unshift [OpenStruct.new({:version => version}), base_triggers]
|
87
82
|
end
|
88
83
|
end
|
@@ -200,8 +195,16 @@ end
|
|
200
195
|
"#{migration_base_name}#{name_version}"
|
201
196
|
end
|
202
197
|
|
198
|
+
def timestamped_migrations
|
199
|
+
if ActiveRecord::VERSION::STRING >= "7.0."
|
200
|
+
ActiveRecord.timestamped_migrations
|
201
|
+
else
|
202
|
+
ActiveRecord::Base.timestamped_migrations
|
203
|
+
end
|
204
|
+
end
|
205
|
+
|
203
206
|
def infer_migration_version(migration_name)
|
204
|
-
|
207
|
+
timestamped_migrations ?
|
205
208
|
Time.now.getutc.strftime("%Y%m%d%H%M%S") :
|
206
209
|
Dir.glob(migration_path + '/*rb').
|
207
210
|
map{ |f| f.gsub(/.*\/(\d+)_.*/, '\1').to_i}.
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: hairtrigger
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Jon Jensen
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2022-
|
11
|
+
date: 2022-12-13 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -16,7 +16,7 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '
|
19
|
+
version: '6.0'
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
22
|
version: '8'
|
@@ -26,7 +26,7 @@ dependencies:
|
|
26
26
|
requirements:
|
27
27
|
- - ">="
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '
|
29
|
+
version: '6.0'
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
32
|
version: '8'
|
@@ -83,7 +83,7 @@ homepage: http://github.com/jenseng/hair_trigger
|
|
83
83
|
licenses:
|
84
84
|
- MIT
|
85
85
|
metadata: {}
|
86
|
-
post_install_message:
|
86
|
+
post_install_message:
|
87
87
|
rdoc_options: []
|
88
88
|
require_paths:
|
89
89
|
- lib
|
@@ -91,15 +91,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
91
91
|
requirements:
|
92
92
|
- - ">="
|
93
93
|
- !ruby/object:Gem::Version
|
94
|
-
version: 2.
|
94
|
+
version: 2.5.0
|
95
95
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
96
96
|
requirements:
|
97
97
|
- - ">="
|
98
98
|
- !ruby/object:Gem::Version
|
99
99
|
version: '0'
|
100
100
|
requirements: []
|
101
|
-
rubygems_version: 3.
|
102
|
-
signing_key:
|
101
|
+
rubygems_version: 3.3.3
|
102
|
+
signing_key:
|
103
103
|
specification_version: 4
|
104
104
|
summary: easy database triggers for active record
|
105
105
|
test_files: []
|