data_migrate 6.3.0 → 6.4.0

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: 7fa861e31bdaa49b654d9c40b11b8a8871f5f8d5c3241d17e0072c43ecf4c0c2
4
- data.tar.gz: 9151be3e992b0271ded30d0bde83a0b57c2236e701762881b75f27a0663ba4a9
3
+ metadata.gz: 80a7f3184322d8547afbf3429a01e0e0bfec10ac3816aaa2d0721505adbe5906
4
+ data.tar.gz: 7419a3c8ba95ffedaa65189fa66fd3273d1897f6f5eb639dc8a6aae9d4fcd981
5
5
  SHA512:
6
- metadata.gz: 3a4004c4a456a1b323add0ee2f7b3012c164763476f0be5957a202afc7388e22a1bc521272c6c359c0c0c0f14dc08b7528edc2ba19a908ac56a692ac1cc76832
7
- data.tar.gz: b8cc321107a19adf0ccae807d755f5743de9c97f8e0fb86db631473d4f169e8bbdd6f5a97cd6a187eb895417051c73379b1ad4cba390dca620835e874e4fa1b3
6
+ metadata.gz: caa9609fecc1f2e00f50462a47ed320a3ba1e7f533028be8d6671b92eeac8ad585997d87d3a49fad6edb0f48ba91fe4e5bbb303f8d84cd34343c7f37b13f35f3
7
+ data.tar.gz: cfc5f3c359e4a7c20a1d9e31455a4cbf0e24d65b3721180414758f22f301c29c4845afa078bd2ae34f6b9a0e265e8928660027d07935b893273b57f7f85bab34
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 6.4.0
4
+
5
+ Add primary key to data_migrations table [aandis](https://github.com/aandis)
6
+
3
7
  ## 6.3.0
4
8
 
5
9
  Add `abort_if_pending_migrations` rake tasks [tomgia](https://github.com/tomgia)
@@ -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.column :version, :string, null: false
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 index_name
10
- "#{table_name_prefix}unique_data_migrations#{table_name_suffix}"
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 index_name
18
- "#{table_name_prefix}unique_data_migrations#{table_name_suffix}"
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 index_name
18
- "#{table_name_prefix}unique_data_migrations#{table_name_suffix}"
17
+ def primary_key
18
+ "version"
19
19
  end
20
20
  end
21
21
 
@@ -1,3 +1,3 @@
1
1
  module DataMigrate
2
- VERSION = "6.3.0".freeze
2
+ VERSION = "6.4.0".freeze
3
3
  end
@@ -9,8 +9,8 @@ describe DataMigrate::DataSchemaMigration do
9
9
  end
10
10
 
11
11
  describe :index_name do
12
- it "returns correct index name" do
13
- expect(subject.index_name).to eq("unique_data_migrations")
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.index_name).to eq("unique_data_migrations")
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.3.0
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-11 00:00:00.000000000 Z
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.0.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.