activerecord-postgres_enum 0.3.0 → 0.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:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8126b681a13ce0266aff512380576a00a47a93a7a018a507dbda0a18ffa7e775
|
4
|
+
data.tar.gz: 3190be425e34c6c3c7116b46afb5fa671e573d831afcbfb3b36ef8ef7b169d23
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5e7e17e5b245b285ec234cf069d31c98d54e5f2f043247ef81956c72859a0f72ccb6ca28dccffcc2e6ac4d318a4fe916982c18a1a338b82f6ccebb1b0fcfd582
|
7
|
+
data.tar.gz: e03ab649fc29e58f7938da1a30648acebe23af42efde515b0241ceb338ec3f7d4e9638d6f15f07aa91a7b9c4fc477ef85521e8b912677ceeac3f3ef06daf6d30
|
@@ -36,6 +36,8 @@ module ActiveRecord
|
|
36
36
|
end
|
37
37
|
|
38
38
|
def rename_enum_value(name, existing_value, new_value)
|
39
|
+
raise "Renaming enum values is only supported in PostgreSQL 10.0+" unless rename_enum_value_supported?
|
40
|
+
|
39
41
|
execute "ALTER TYPE #{name} RENAME VALUE '#{existing_value}' TO '#{new_value}'"
|
40
42
|
end
|
41
43
|
|
@@ -48,6 +50,10 @@ module ActiveRecord
|
|
48
50
|
spec[:enum_name] = column.cast_type.enum_name.inspect if column.type == :enum
|
49
51
|
spec
|
50
52
|
end
|
53
|
+
|
54
|
+
def rename_enum_value_supported?
|
55
|
+
ActiveRecord::Base.connection.send(:postgresql_version) >= 100_000
|
56
|
+
end
|
51
57
|
end
|
52
58
|
end
|
53
59
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: activerecord-postgres_enum
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Merkushin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-02-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -17,9 +17,6 @@ dependencies:
|
|
17
17
|
- - ">="
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: 4.2.0
|
20
|
-
- - "<="
|
21
|
-
- !ruby/object:Gem::Version
|
22
|
-
version: '5.2'
|
23
20
|
type: :runtime
|
24
21
|
prerelease: false
|
25
22
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -27,23 +24,20 @@ dependencies:
|
|
27
24
|
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: 4.2.0
|
30
|
-
- - "<="
|
31
|
-
- !ruby/object:Gem::Version
|
32
|
-
version: '5.2'
|
33
27
|
- !ruby/object:Gem::Dependency
|
34
28
|
name: pg
|
35
29
|
requirement: !ruby/object:Gem::Requirement
|
36
30
|
requirements:
|
37
|
-
- - "
|
31
|
+
- - ">="
|
38
32
|
- !ruby/object:Gem::Version
|
39
|
-
version: '
|
33
|
+
version: '0'
|
40
34
|
type: :runtime
|
41
35
|
prerelease: false
|
42
36
|
version_requirements: !ruby/object:Gem::Requirement
|
43
37
|
requirements:
|
44
|
-
- - "
|
38
|
+
- - ">="
|
45
39
|
- !ruby/object:Gem::Version
|
46
|
-
version: '
|
40
|
+
version: '0'
|
47
41
|
- !ruby/object:Gem::Dependency
|
48
42
|
name: appraisal
|
49
43
|
requirement: !ruby/object:Gem::Requirement
|
@@ -62,14 +56,14 @@ dependencies:
|
|
62
56
|
name: bundler
|
63
57
|
requirement: !ruby/object:Gem::Requirement
|
64
58
|
requirements:
|
65
|
-
- - "
|
59
|
+
- - ">="
|
66
60
|
- !ruby/object:Gem::Version
|
67
61
|
version: '1.16'
|
68
62
|
type: :development
|
69
63
|
prerelease: false
|
70
64
|
version_requirements: !ruby/object:Gem::Requirement
|
71
65
|
requirements:
|
72
|
-
- - "
|
66
|
+
- - ">="
|
73
67
|
- !ruby/object:Gem::Version
|
74
68
|
version: '1.16'
|
75
69
|
- !ruby/object:Gem::Dependency
|