migration_tools 1.8.0 → 1.9.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/migration_tools/tasks.rb +21 -4
- 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: 6f478f9c844bb173b7694e644e031854615195974cb1166f64a58b621c7a27c7
|
4
|
+
data.tar.gz: f4f43cee11b6d5667e31b0f1a2b4b59834c6a0cb78acb5d11400ee8115e7a5d6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4d263af9575ac963f4d2e526fc0c02ba870f745ced953be1d44d8ab11cd3bb40c98b4e688c5e2196533e0116546be4d6c6f1d661853451ea0f8d5f2acb85e7a0
|
7
|
+
data.tar.gz: 347b05bd236520fbe54330909648be9e82e90a663194439ab80d34ddf21f65a236f27b844cdc6638f09b37bb2061e6a2a98337c9fdcb32870a8e279120d57954
|
@@ -28,7 +28,12 @@ module MigrationTools
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def migrator(target_version = nil)
|
31
|
-
if ActiveRecord::VERSION::MAJOR >=
|
31
|
+
if ActiveRecord::VERSION::MAJOR >= 7 && ActiveRecord::VERSION::MINOR >= 1
|
32
|
+
migrate_up(ActiveRecord::MigrationContext.new(
|
33
|
+
migrations_paths,
|
34
|
+
ActiveRecord::Base.connection.schema_migration
|
35
|
+
).migrations, target_version)
|
36
|
+
elsif ActiveRecord::VERSION::MAJOR >= 6
|
32
37
|
migrate_up(ActiveRecord::MigrationContext.new(
|
33
38
|
migrations_paths,
|
34
39
|
ActiveRecord::SchemaMigration
|
@@ -41,7 +46,13 @@ module MigrationTools
|
|
41
46
|
end
|
42
47
|
|
43
48
|
def migrate_up(migrations, target_version)
|
44
|
-
if ActiveRecord::VERSION::MAJOR
|
49
|
+
if ActiveRecord::VERSION::MAJOR >= 7 && ActiveRecord::VERSION::MINOR >= 1
|
50
|
+
ActiveRecord::Migrator.new(:up, migrations,
|
51
|
+
ActiveRecord::Base.connection.schema_migration,
|
52
|
+
ActiveRecord::Base.connection.internal_metadata,
|
53
|
+
target_version
|
54
|
+
)
|
55
|
+
elsif ActiveRecord::VERSION::MAJOR >= 6
|
45
56
|
ActiveRecord::Migrator.new(:up, migrations, ActiveRecord::SchemaMigration, target_version)
|
46
57
|
else
|
47
58
|
ActiveRecord::Migrator.new(:up, migrations, target_version)
|
@@ -88,8 +99,14 @@ module MigrationTools
|
|
88
99
|
migrator(migration.version).run
|
89
100
|
end
|
90
101
|
|
91
|
-
|
92
|
-
|
102
|
+
schema_format = if ActiveRecord::VERSION::MAJOR >= 7
|
103
|
+
ActiveRecord.schema_format
|
104
|
+
else
|
105
|
+
ActiveRecord::Base.schema_format
|
106
|
+
end
|
107
|
+
|
108
|
+
Rake::Task["db:schema:dump"].invoke if schema_format == :ruby
|
109
|
+
Rake::Task["db:structure:dump"].invoke if schema_format == :sql
|
93
110
|
end
|
94
111
|
end
|
95
112
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: migration_tools
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.9.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Morten Primdahl
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2023-11-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: 4.2.0
|
20
20
|
- - "<"
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: '7.
|
22
|
+
version: '7.2'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: 4.2.0
|
30
30
|
- - "<"
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: '7.
|
32
|
+
version: '7.2'
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: rake
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -127,7 +127,7 @@ homepage: https://github.com/zendesk/migration_tools
|
|
127
127
|
licenses:
|
128
128
|
- Apache-2.0
|
129
129
|
metadata: {}
|
130
|
-
post_install_message:
|
130
|
+
post_install_message:
|
131
131
|
rdoc_options: []
|
132
132
|
require_paths:
|
133
133
|
- lib
|
@@ -135,15 +135,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
135
135
|
requirements:
|
136
136
|
- - ">="
|
137
137
|
- !ruby/object:Gem::Version
|
138
|
-
version: 2.
|
138
|
+
version: 2.6.0
|
139
139
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
140
140
|
requirements:
|
141
141
|
- - ">="
|
142
142
|
- !ruby/object:Gem::Version
|
143
143
|
version: '0'
|
144
144
|
requirements: []
|
145
|
-
rubygems_version: 3.1
|
146
|
-
signing_key:
|
145
|
+
rubygems_version: 3.0.3.1
|
146
|
+
signing_key:
|
147
147
|
specification_version: 4
|
148
148
|
summary: Encourage migrations that do not require downtime
|
149
149
|
test_files: []
|