data_migrate 5.1.0 → 5.2.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
- SHA1:
3
- metadata.gz: 374e93835d9a65e56af9ce534dd650c286a3dbcf
4
- data.tar.gz: 48a7b7a1b7870b28f4cc34bff8468cc797649c8d
2
+ SHA256:
3
+ metadata.gz: aae65effdc868c62166684eabdeb9ab2799aa4804b6172fe4ff541b1193fba54
4
+ data.tar.gz: 3c50deaf50da13456a9e078ae0df07d269335b312863c88b0807f58bb3fdcffa
5
5
  SHA512:
6
- metadata.gz: 3b53c608118790f93587e29221f7d5aad40fcbe782f081f314d3955228f6ad45f2fbe90b565221aeb90fb38fe6642883f850b31ae7ec8d925b7b34c7a07cc2b7
7
- data.tar.gz: 1500d7f084fcdc4b8f0a442925a695c90b495a148da5ba6021add79d432c8826c6bc2b965bc178595796d92fe8d990f931860f02e0fadcc68674546e366bf2bf
6
+ metadata.gz: 650d0315aa2cbb3549fdd1104bf2f471a141519aee4b51589a988b027e496a4ea8659b160e651a5f8b9a88cd7fe6a41822e0de65b96e3e01591bdef4cac3e3c7
7
+ data.tar.gz: 21f4a447c422b8470a4968a48b6e9e56fdcf798bff9f92ef2dcf1a84283d6c790f73dd1d54c0992e15cec11ca4ac10b0ec429a7fe68d5f28fb70e2a7d4119d17
@@ -3,16 +3,15 @@
3
3
  require "active_record"
4
4
 
5
5
  module DataMigrate
6
-
7
6
  class DataMigrator < ActiveRecord::Migrator
8
7
 
9
8
  def record_version_state_after_migrating(version)
10
9
  if down?
11
10
  migrated.delete(version)
12
- DataMigrate::DataSchemaMigration.where(:version => version.to_s).delete_all
11
+ DataMigrate::DataSchemaMigration.where(version: version.to_s).delete_all
13
12
  else
14
13
  migrated << version
15
- DataMigrate::DataSchemaMigration.create!(:version => version.to_s)
14
+ DataMigrate::DataSchemaMigration.create!(version: version.to_s)
16
15
  end
17
16
  end
18
17
 
@@ -70,17 +69,18 @@ module DataMigrate
70
69
  private
71
70
 
72
71
  def create_table(sm_table)
73
- ActiveRecord::Base.connection.create_table(sm_table, :id => false) do |schema_migrations_table|
74
- schema_migrations_table.column :version, :string, :null => false
75
- end
72
+ ActiveRecord::Base.connection.create_table(sm_table, id: false) do |schema_migrations_table|
73
+ schema_migrations_table.column :version, :string, null: false
74
+ end
75
+
76
+ suffix = ActiveRecord::Base.table_name_suffix
77
+ prefix = ActiveRecord::Base.table_name_prefix
78
+ index_name = "#{prefix}unique_data_migrations#{suffix}"
76
79
 
77
- suffix = ActiveRecord::Base.table_name_suffix
78
- prefix = ActiveRecord::Base.table_name_prefix
79
- index_name = "#{prefix}unique_data_migrations#{suffix}"
80
+ options = {unique: true, name: index_name}
81
+ options[:length] = 191 if ActiveRecord::Base.connection_config[:adapter] == "mysql2"
80
82
 
81
- ActiveRecord::Base.connection.add_index sm_table, :version,
82
- :unique => true,
83
- :name => index_name
83
+ ActiveRecord::Base.connection.add_index sm_table, :version, options
84
84
  end
85
85
 
86
86
  def table_exists?(connection, table_name)
@@ -1,3 +1,3 @@
1
1
  module DataMigrate
2
- VERSION = "5.1.0".freeze
2
+ VERSION = "5.2.0".freeze
3
3
  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: 5.1.0
4
+ version: 5.2.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: 2018-09-12 00:00:00.000000000 Z
13
+ date: 2018-10-03 00:00:00.000000000 Z
14
14
  dependencies:
15
15
  - !ruby/object:Gem::Dependency
16
16
  name: rails
@@ -275,7 +275,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
275
275
  version: '0'
276
276
  requirements: []
277
277
  rubyforge_project: data_migrate
278
- rubygems_version: 2.6.13
278
+ rubygems_version: 2.7.4
279
279
  signing_key:
280
280
  specification_version: 4
281
281
  summary: Rake tasks to migrate data alongside schema changes.