webdack-uuid_migration 1.0.3 → 1.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8940b7a9083a5b6ceeff3024f71b6d4ed26458df
4
- data.tar.gz: fe7ad3d82d1b173fbae6cacb00e025b51f3b08ab
3
+ metadata.gz: dfced37886b6889ece73a47e8d03d57c93890753
4
+ data.tar.gz: 3a65cc8443ebd721be24a2dc21d919ccac67d339
5
5
  SHA512:
6
- metadata.gz: 9367f618d3fbf87204eb060dada5bae50d75b289b34c5cd7c0810e476374fe51bb8c3a37ca8066ce272c659119a40a330d0dcf350087dd54bfb9669eb06ebc2f
7
- data.tar.gz: b1f5bc8c89eb9b2d9b05bb643ef41e7383af154f5964b24403b4ff494b726fe6b4457d63a0311072f59443f7d8334b51e790f924b60b8a8342f8bc9f059da6b2
6
+ metadata.gz: 44273137d0dbefe4da856e0d2e0813176cc4e600936a347117eec69d65c86ba443bd5aa679f28c7edc4667bc25f6c394e5bb8071f058dfe191c78b6697e2beca
7
+ data.tar.gz: fdba841d3643e172fdbc9dd691298830a2ec9d9056b3048cf4bad0984eac20798dd72249cc4a3fc5bafe6e25dbfd35710291d4cfe8d7b2456d901487d206dc19
data/.gitignore CHANGED
@@ -5,6 +5,7 @@
5
5
  .yardoc
6
6
  .idea
7
7
  Gemfile.lock
8
+ gemfiles/*.lock
8
9
  InstalledFiles
9
10
  _yardoc
10
11
  coverage
data/.travis.yml CHANGED
@@ -1,9 +1,9 @@
1
1
  rvm:
2
- - 1.9.3
3
2
  - 2.0.0
4
3
  - 2.1.10
5
- - 2.2.5
6
- - 2.3.1
4
+ - 2.2.8
5
+ - 2.3.5
6
+ - 2.4.2
7
7
 
8
8
  gemfile:
9
9
  - gemfiles/rails40.gemfile
@@ -14,5 +14,16 @@ script: bundle exec rspec spec
14
14
 
15
15
  matrix:
16
16
  include:
17
- - rvm: 2.3.1
17
+ - rvm: 2.3.5
18
18
  gemfile: gemfiles/rails50.gemfile
19
+ - rvm: 2.4.2
20
+ gemfile: gemfiles/rails50.gemfile
21
+ - rvm: 2.3.5
22
+ gemfile: gemfiles/rails51.gemfile
23
+ - rvm: 2.4.2
24
+ gemfile: gemfiles/rails51.gemfile
25
+ exclude:
26
+ - rvm: 2.4.2
27
+ gemfile: gemfiles/rails40.gemfile
28
+ - rvm: 2.4.2
29
+ gemfile: gemfiles/rails41.gemfile
data/README.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  [![Build Status](https://travis-ci.org/kreatio-sw/webdack-uuid_migration.svg?branch=master)](https://travis-ci.org/kreatio-sw/webdack-uuid_migration)
4
4
 
5
+ **This project is actively maintained. Please report issues and/or create
6
+ pull requests if you face any issues.**
7
+
5
8
  Helper methods to migrate Integer columns to UUID columns during migrations in PostgreSQL.
6
9
  It supports migrating primary key columns as well.
7
10
 
@@ -130,10 +133,16 @@ Example:
130
133
 
131
134
  ## Compatibility
132
135
 
133
- Works only with Rails 4 & Rails 5. It uses Rails4's out-of-the-box UUID support for PostgreSQL. Works with Ruby 1.9.3,
134
- 2.0.0, 2.1.1, and 2.3.0.
136
+ Works only with Rails 4 & Rails 5. It uses Rails4's out-of-the-box UUID support for PostgreSQL. Works with following
137
+ Ruby versions:
138
+
139
+ - 2.0.0
140
+ - 2.1.10
141
+ - 2.2.8
142
+ - 2.3.5
143
+ - 2.4.2
135
144
 
136
- Tested with Rails 5.0.0.
145
+ Tested with Rails 5.0.x and 5.1.x. Reported working with 5.2.0 alpha.
137
146
 
138
147
  To run the test suite:
139
148
 
@@ -145,6 +154,7 @@ To run the test suite:
145
154
 
146
155
  - Users of the Gem
147
156
  - [Felix Bünemann](https://github.com/felixbuenemann) for checking compatibility with Rails 4.1
157
+ - [Nick Schwaderer](https://github.com/Schwad) Rials 5.2.x compatibility
148
158
 
149
159
  ## Contributing
150
160
 
@@ -0,0 +1,5 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "activerecord", "~>5.1.0"
4
+
5
+ gemspec :path=>"../"
@@ -0,0 +1,5 @@
1
+ source "https://rubygems.org"
2
+
3
+ gem "activerecord", "~>5.2.0"
4
+
5
+ gemspec :path=>"../"
@@ -33,6 +33,14 @@ module Webdack
33
33
  options
34
34
  end
35
35
  end
36
+
37
+ def extract_foreign_key_action(specifier)
38
+ case specifier
39
+ when "c"; :cascade
40
+ when "n"; :nullify
41
+ when "r"; :restrict
42
+ end
43
+ end
36
44
 
37
45
  def drop_foreign_keys(foreign_keys)
38
46
  foreign_keys.each do |fk_key_spec|
@@ -2,6 +2,6 @@
2
2
  module Webdack
3
3
  #
4
4
  module UUIDMigration
5
- VERSION = "1.0.3"
5
+ VERSION = "1.1.0"
6
6
  end
7
7
  end
data/spec/spec_helper.rb CHANGED
@@ -12,3 +12,9 @@ RSpec.configure do |c|
12
12
  c.filter_run_excluding rails_4_2_or_newer: true
13
13
  end
14
14
  end
15
+
16
+ ActiveRecordMigration = if ActiveRecord.version >= Gem::Version.new('5.0.0')
17
+ ActiveRecord::Migration[5.0]
18
+ else
19
+ ActiveRecord::Migration
20
+ end
@@ -3,7 +3,7 @@
3
3
  PG_SPEC = {
4
4
  :adapter => 'postgresql',
5
5
  :database => 'webdack_uuid_migration_helper_test',
6
- :username => 'postgres',
6
+ :username => 'kdeepak',
7
7
  :encoding => 'utf8'
8
8
  }
9
9
 
@@ -1,6 +1,6 @@
1
1
  require_relative 'spec_helper'
2
2
 
3
- class MigrationBase < ActiveRecord::Migration
3
+ class MigrationBase < ActiveRecordMigration
4
4
  def change
5
5
  create_table :states, primary_key: :stateid do |t|
6
6
  t.string :name
@@ -10,7 +10,7 @@ class MigrationBase < ActiveRecord::Migration
10
10
  end
11
11
  end
12
12
 
13
- class Migration01 < ActiveRecord::Migration
13
+ class Migration01 < ActiveRecordMigration
14
14
  def change
15
15
  reversible do |dir|
16
16
  dir.up do
@@ -24,7 +24,7 @@ class Migration01 < ActiveRecord::Migration
24
24
  end
25
25
  end
26
26
 
27
- class Migration02 < ActiveRecord::Migration
27
+ class Migration02 < ActiveRecordMigration
28
28
  def change
29
29
  reversible do |dir|
30
30
  dir.up do
@@ -38,7 +38,7 @@ class Migration02 < ActiveRecord::Migration
38
38
  end
39
39
  end
40
40
 
41
- class Migration03 < ActiveRecord::Migration
41
+ class Migration03 < ActiveRecordMigration
42
42
  def change
43
43
  reversible do |dir|
44
44
  dir.up do
@@ -1,6 +1,6 @@
1
1
  require_relative 'spec_helper'
2
2
 
3
- class BasicMigration < ActiveRecord::Migration
3
+ class BasicMigration < ActiveRecordMigration
4
4
  def change
5
5
  reversible do |dir|
6
6
  dir.up do
@@ -17,7 +17,7 @@ class BasicMigration < ActiveRecord::Migration
17
17
  end
18
18
  end
19
19
 
20
- class MigrateAllOneGo < ActiveRecord::Migration
20
+ class MigrateAllOneGo < ActiveRecordMigration
21
21
  def change
22
22
  reversible do |dir|
23
23
  dir.up do
@@ -38,7 +38,7 @@ class MigrateAllOneGo < ActiveRecord::Migration
38
38
  end
39
39
  end
40
40
 
41
- class MigrateWithFk < ActiveRecord::Migration
41
+ class MigrateWithFk < ActiveRecordMigration
42
42
  def change
43
43
  reversible do |dir|
44
44
  dir.up do
@@ -54,7 +54,7 @@ class MigrateWithFk < ActiveRecord::Migration
54
54
  end
55
55
  end
56
56
 
57
- class MigrateStep01 < ActiveRecord::Migration
57
+ class MigrateStep01 < ActiveRecordMigration
58
58
  def change
59
59
  reversible do |dir|
60
60
  dir.up do
@@ -77,7 +77,7 @@ class MigrateStep01 < ActiveRecord::Migration
77
77
  end
78
78
  end
79
79
 
80
- class MigrateStep02 < ActiveRecord::Migration
80
+ class MigrateStep02 < ActiveRecordMigration
81
81
  def change
82
82
  reversible do |dir|
83
83
  dir.up do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: webdack-uuid_migration
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.3
4
+ version: 1.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Deepak Kumar
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-27 00:00:00.000000000 Z
11
+ date: 2017-10-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -126,6 +126,8 @@ files:
126
126
  - gemfiles/rails41.gemfile
127
127
  - gemfiles/rails42.gemfile
128
128
  - gemfiles/rails50.gemfile
129
+ - gemfiles/rails51.gemfile
130
+ - gemfiles/rails52.gemfile
129
131
  - lib/webdack/uuid_migration.rb
130
132
  - lib/webdack/uuid_migration/helpers.rb
131
133
  - lib/webdack/uuid_migration/schema_helpers.rb
@@ -162,7 +164,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
162
164
  version: '0'
163
165
  requirements: []
164
166
  rubyforge_project:
165
- rubygems_version: 2.5.1
167
+ rubygems_version: 2.6.13
166
168
  signing_key:
167
169
  specification_version: 4
168
170
  summary: Useful helpers to migrate Integer id columns to UUID in PostgreSql.