ar_firebird_adapter 1.0.5 → 1.0.6

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: a4e366fbf4e16c36999bbe36dbebccb48ad5b5c6fe465119fdb9059735b94af4
4
- data.tar.gz: a9a4456617ab3348fe7f9482523ec653f2c079ace7a337b4bfe283e4fd19565a
3
+ metadata.gz: 6a48598925e99638897dd6cceb351dc829efbf2d8b560be0307800b7b4433a53
4
+ data.tar.gz: 360c1d980ad13ca646ff3c07a4093bc4957bd9531fbb08b2b34b1319a66415e1
5
5
  SHA512:
6
- metadata.gz: d37e2abe7141218ba81ff3dd6d5b58ef37639a4d828b5782540f032c386d7a173b04ee5262440f0eed8f2cf14526ad9f4ca9702898458cb82d77a345e757a7b0
7
- data.tar.gz: db10de04dc27a9d95320c36bec79858728164817431c99304f7cba6b82d69a327e96297f6b9c43fd66dc795964e7fea116e9690ad310d2160835b84463d3ecbd
6
+ metadata.gz: a08e764b6a79934ffdb8baa070288edc80e4b96a54f810d56ed382022e0adf90f295292a1dd2f8f7e83ab2811285e4e98e9d82f13a90a26046450420ea5c79ae
7
+ data.tar.gz: dbd2b2c7874a746cd0dad58ff391de6c3a78da7a63fcfcfb70e89ea91f58288748efe523e157734ac01ad267b88d384d91f8d36a10b5b5931b76d0ce4c9506c1
@@ -112,9 +112,10 @@ module ActiveRecord
112
112
 
113
113
  def change_column(table_name, column_name, type, options = {}) #:nodoc:
114
114
  clear_cache!
115
- type = type_to_sql(type)
115
+ type = (options[:limit] == 8 && type == :integer) ? "bigint" : type_to_sql(type, **options)
116
+
116
117
  column = column_definitions(table_name.to_sym).find {|column| column["name"] == column_name.to_s }
117
- if options[:limit]
118
+ if options[:limit] && type != "bigint"
118
119
  type = "#{type.gsub(/\(.*\)/,'')}(#{options[:limit]})"
119
120
  end
120
121
 
@@ -125,6 +126,12 @@ module ActiveRecord
125
126
  execute "ALTER TABLE #{table_name} #{sql.join(', ')}" if sql.any?
126
127
  end
127
128
 
129
+
130
+ def add_column(table_name, column_name, type, **options)
131
+ type = (options[:limit] == 8 && type == :integer) ? :bigint : type
132
+ super(table_name, column_name, type, **options)
133
+ end
134
+
128
135
  private
129
136
 
130
137
  def column_definitions(table_name)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ar_firebird_adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.5
4
+ version: 1.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fábio Rodrigues