data_migrate 6.3.0 → 6.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/Changelog.md +4 -0
- data/lib/data_migrate/data_migrator.rb +1 -10
- data/lib/data_migrate/data_schema_migration.rb +2 -2
- data/lib/data_migrate/migration.rb +2 -2
- data/lib/data_migrate/migration_five.rb +2 -2
- data/lib/data_migrate/version.rb +1 -1
- data/spec/data_migrate/data_schema_migration_spec.rb +2 -2
- data/spec/data_migrate/migration.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 80a7f3184322d8547afbf3429a01e0e0bfec10ac3816aaa2d0721505adbe5906
|
4
|
+
data.tar.gz: 7419a3c8ba95ffedaa65189fa66fd3273d1897f6f5eb639dc8a6aae9d4fcd981
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: caa9609fecc1f2e00f50462a47ed320a3ba1e7f533028be8d6671b92eeac8ad585997d87d3a49fad6edb0f48ba91fe4e5bbb303f8d84cd34343c7f37b13f35f3
|
7
|
+
data.tar.gz: cfc5f3c359e4a7c20a1d9e31455a4cbf0e24d65b3721180414758f22f301c29c4845afa078bd2ae34f6b9a0e265e8928660027d07935b893273b57f7f85bab34
|
data/Changelog.md
CHANGED
@@ -76,17 +76,8 @@ module DataMigrate
|
|
76
76
|
|
77
77
|
def create_table(sm_table)
|
78
78
|
ActiveRecord::Base.connection.create_table(sm_table, id: false) do |schema_migrations_table|
|
79
|
-
schema_migrations_table.
|
79
|
+
schema_migrations_table.string :version, primary_key: true
|
80
80
|
end
|
81
|
-
|
82
|
-
suffix = ActiveRecord::Base.table_name_suffix
|
83
|
-
prefix = ActiveRecord::Base.table_name_prefix
|
84
|
-
index_name = "#{prefix}unique_data_migrations#{suffix}"
|
85
|
-
|
86
|
-
options = {unique: true, name: index_name}
|
87
|
-
options[:length] = 191 if ActiveRecord::Base.connection_config[:adapter] == "mysql2"
|
88
|
-
|
89
|
-
ActiveRecord::Base.connection.add_index sm_table, :version, options
|
90
81
|
end
|
91
82
|
|
92
83
|
def table_exists?(connection, table_name)
|
@@ -6,8 +6,8 @@ module DataMigrate
|
|
6
6
|
ActiveRecord::Base.table_name_prefix + 'data_migrations' + ActiveRecord::Base.table_name_suffix
|
7
7
|
end
|
8
8
|
|
9
|
-
def
|
10
|
-
"
|
9
|
+
def primary_key
|
10
|
+
"version"
|
11
11
|
end
|
12
12
|
end
|
13
13
|
end
|
@@ -14,8 +14,8 @@ module DataMigrate
|
|
14
14
|
ActiveRecord::Base.table_name_prefix + "data_migrations" + ActiveRecord::Base.table_name_suffix
|
15
15
|
end
|
16
16
|
|
17
|
-
def
|
18
|
-
"
|
17
|
+
def primary_key
|
18
|
+
"version"
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
@@ -14,8 +14,8 @@ module DataMigrate
|
|
14
14
|
ActiveRecord::Base.table_name_prefix + 'data_migrations' + ActiveRecord::Base.table_name_suffix
|
15
15
|
end
|
16
16
|
|
17
|
-
def
|
18
|
-
"
|
17
|
+
def primary_key
|
18
|
+
"version"
|
19
19
|
end
|
20
20
|
end
|
21
21
|
|
data/lib/data_migrate/version.rb
CHANGED
@@ -9,8 +9,8 @@ describe DataMigrate::DataSchemaMigration do
|
|
9
9
|
end
|
10
10
|
|
11
11
|
describe :index_name do
|
12
|
-
it "returns correct
|
13
|
-
expect(subject.
|
12
|
+
it "returns correct primary key name" do
|
13
|
+
expect(subject.primary_key).to eq("version")
|
14
14
|
end
|
15
15
|
end
|
16
16
|
end
|
@@ -14,6 +14,6 @@ describe subject do
|
|
14
14
|
it "uses correct index name" do
|
15
15
|
expect(subject).to receive(:table_name_prefix) { "" }
|
16
16
|
expect(subject).to receive(:table_name_suffix) { "" }
|
17
|
-
expect(subject.
|
17
|
+
expect(subject.primary_key).to eq("version")
|
18
18
|
end
|
19
19
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: data_migrate
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 6.
|
4
|
+
version: 6.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Andrew J Vargo
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2020-03
|
13
|
+
date: 2020-10-03 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: rails
|
@@ -288,7 +288,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
288
288
|
- !ruby/object:Gem::Version
|
289
289
|
version: '0'
|
290
290
|
requirements: []
|
291
|
-
rubygems_version: 3.
|
291
|
+
rubygems_version: 3.1.2
|
292
292
|
signing_key:
|
293
293
|
specification_version: 4
|
294
294
|
summary: Rake tasks to migrate data alongside schema changes.
|