marty 1.0.41 → 1.0.42
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/lib/marty/migrations.rb +6 -7
- data/lib/marty/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: c9b9b42bbdeeada46c3064d29dc28140076dbb2a
|
|
4
|
+
data.tar.gz: afa5534bdeb008725d64f7ac81c342ad58c6a7f9
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 578d03d84c806f58c5ac5caca2f25535de98e0499cb78cda5c2329ce25a50218cf500114e332ecd9cbdc3b696dd3ac881f28ceac69fa184c5d50d543496276d3
|
|
7
|
+
data.tar.gz: 54991e5001815e0adcfd5eea4108cd15cdd234dc7a698bafffae8299fcc9434f5c33e62e6a99133deab0030aa78459b005396e718b5c0c5653cc763294ad5d61
|
data/lib/marty/migrations.rb
CHANGED
|
@@ -23,6 +23,7 @@ module Marty::Migrations
|
|
|
23
23
|
SQL
|
|
24
24
|
end
|
|
25
25
|
|
|
26
|
+
# NOTE: calling migrations need to disable_ddl_transaction!
|
|
26
27
|
def update_enum(klass, prefix_override = nil)
|
|
27
28
|
raise "bad class arg #{klass}" unless
|
|
28
29
|
klass.is_a?(Class) && klass < ActiveRecord::Base
|
|
@@ -41,10 +42,9 @@ module Marty::Migrations
|
|
|
41
42
|
|
|
42
43
|
db_values = res.first['enum_range'].gsub(/[{"}]/, '').split(',')
|
|
43
44
|
ex_values = klass::VALUES - db_values
|
|
44
|
-
puts "no new #{klass}::VALUES to add" if ex_values.empty?
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
return if ex_values.empty?
|
|
47
|
+
|
|
48
48
|
ex_values.each do |v|
|
|
49
49
|
prepped_v = ActiveRecord::Base.connection.quote(v)
|
|
50
50
|
|
|
@@ -52,7 +52,6 @@ module Marty::Migrations
|
|
|
52
52
|
ALTER TYPE #{enum_name} ADD VALUE #{prepped_v};
|
|
53
53
|
SQL
|
|
54
54
|
end
|
|
55
|
-
execute("BEGIN;")
|
|
56
55
|
end
|
|
57
56
|
|
|
58
57
|
def add_fk(from_table, to_table, options = {})
|
|
@@ -77,9 +76,9 @@ module Marty::Migrations
|
|
|
77
76
|
# created_dt/obsoleted_dt need to be indexed since they appear in
|
|
78
77
|
# almost all queries.
|
|
79
78
|
MCFLY_INDEX_COLUMNS = [
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
79
|
+
:created_dt,
|
|
80
|
+
:obsoleted_dt,
|
|
81
|
+
]
|
|
83
82
|
|
|
84
83
|
def add_mcfly_index(tb, *attrs)
|
|
85
84
|
tb = "#{tb_prefix}#{tb}" unless
|
data/lib/marty/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: marty
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 1.0.
|
|
4
|
+
version: 1.0.42
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Arman Bostani
|
|
@@ -14,7 +14,7 @@ authors:
|
|
|
14
14
|
autorequire:
|
|
15
15
|
bindir: bin
|
|
16
16
|
cert_chain: []
|
|
17
|
-
date: 2017-10-
|
|
17
|
+
date: 2017-10-06 00:00:00.000000000 Z
|
|
18
18
|
dependencies:
|
|
19
19
|
- !ruby/object:Gem::Dependency
|
|
20
20
|
name: pg
|