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 +4 -4
- data/.gitignore +1 -0
- data/.travis.yml +15 -4
- data/README.md +13 -3
- data/gemfiles/rails51.gemfile +5 -0
- data/gemfiles/rails52.gemfile +5 -0
- data/lib/webdack/uuid_migration/schema_helpers.rb +8 -0
- data/lib/webdack/uuid_migration/version.rb +1 -1
- data/spec/spec_helper.rb +6 -0
- data/spec/support/pg_database_helper.rb +1 -1
- data/spec/uuid_custom_pk_spec.rb +4 -4
- data/spec/uuid_migrate_helper_spec.rb +5 -5
- metadata +5 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: dfced37886b6889ece73a47e8d03d57c93890753
|
4
|
+
data.tar.gz: 3a65cc8443ebd721be24a2dc21d919ccac67d339
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 44273137d0dbefe4da856e0d2e0813176cc4e600936a347117eec69d65c86ba443bd5aa679f28c7edc4667bc25f6c394e5bb8071f058dfe191c78b6697e2beca
|
7
|
+
data.tar.gz: fdba841d3643e172fdbc9dd691298830a2ec9d9056b3048cf4bad0984eac20798dd72249cc4a3fc5bafe6e25dbfd35710291d4cfe8d7b2456d901487d206dc19
|
data/.gitignore
CHANGED
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.
|
6
|
-
- 2.3.
|
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.
|
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
|
[](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
|
134
|
-
|
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
|
|
@@ -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|
|
data/spec/spec_helper.rb
CHANGED
data/spec/uuid_custom_pk_spec.rb
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
require_relative 'spec_helper'
|
2
2
|
|
3
|
-
class MigrationBase <
|
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 <
|
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 <
|
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 <
|
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 <
|
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 <
|
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 <
|
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 <
|
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 <
|
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
|
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:
|
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.
|
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.
|