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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: deedaa5ae6db6c27c680a5cdb6707de3a5f4f06a
4
- data.tar.gz: 7c86319dca00f3dc47356642bfa68d955472e8be
3
+ metadata.gz: c9b9b42bbdeeada46c3064d29dc28140076dbb2a
4
+ data.tar.gz: afa5534bdeb008725d64f7ac81c342ad58c6a7f9
5
5
  SHA512:
6
- metadata.gz: 6abef04a5d54ec802bc3d0019a68b90b706a9b49aa2a5f7beecac8b195be8e71d8b487d5d8336ddc60892472b947042c342c57e8828c768cdb7f8292a3788304
7
- data.tar.gz: 892af85ab6b7af8671b1de303e07317d5db34fc8ce65e10d42b4e919ff5b98c71b27e068deb709b961218578950670c5a84881bd906b9cc512d2bbd5ac65b855
6
+ metadata.gz: 578d03d84c806f58c5ac5caca2f25535de98e0499cb78cda5c2329ce25a50218cf500114e332ecd9cbdc3b696dd3ac881f28ceac69fa184c5d50d543496276d3
7
+ data.tar.gz: 54991e5001815e0adcfd5eea4108cd15cdd234dc7a698bafffae8299fcc9434f5c33e62e6a99133deab0030aa78459b005396e718b5c0c5653cc763294ad5d61
@@ -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
- #hack to prevent transaction
47
- execute("COMMIT;")
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
- :created_dt,
81
- :obsoleted_dt,
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
@@ -1,3 +1,3 @@
1
1
  module Marty
2
- VERSION = "1.0.41"
2
+ VERSION = "1.0.42"
3
3
  end
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.41
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-03 00:00:00.000000000 Z
17
+ date: 2017-10-06 00:00:00.000000000 Z
18
18
  dependencies:
19
19
  - !ruby/object:Gem::Dependency
20
20
  name: pg