ar_firebird_adapter 1.0.4 → 1.0.5

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: af42ea2984ae7dd03414715ca98722150e355b3821777c6dd7c3f2b8f75068ce
4
- data.tar.gz: f3c313959cdb65c12698c9b2e2914a1cb505ec61c27fc7139b4db79c9bd3a680
3
+ metadata.gz: a4e366fbf4e16c36999bbe36dbebccb48ad5b5c6fe465119fdb9059735b94af4
4
+ data.tar.gz: a9a4456617ab3348fe7f9482523ec653f2c079ace7a337b4bfe283e4fd19565a
5
5
  SHA512:
6
- metadata.gz: 78b32a05c9a84554f33a0adca51ca6d8bd12baf83074facfd4ac39473c9b6c3d6bc2af914612151f2d61bc17145d9cdf0865ae953724d15fb434f6946afb4faa
7
- data.tar.gz: 0d116c295ebf1f8e41df1ee189c3fafd3e977bcf1cf478a5e3c161e1ba4c6b7c0127c1bdab4491675540d2acd1557c914032b9d14d725b2de943d4c2e50491ac
6
+ metadata.gz: d37e2abe7141218ba81ff3dd6d5b58ef37639a4d828b5782540f032c386d7a173b04ee5262440f0eed8f2cf14526ad9f4ca9702898458cb82d77a345e757a7b0
7
+ data.tar.gz: db10de04dc27a9d95320c36bec79858728164817431c99304f7cba6b82d69a327e96297f6b9c43fd66dc795964e7fea116e9690ad310d2160835b84463d3ecbd
@@ -56,8 +56,15 @@ module ActiveRecord::ConnectionAdapters::ArFirebird::DatabaseStatements
56
56
  end
57
57
 
58
58
  def create_table(table_name, **options)
59
- super
60
-
59
+ super(table_name, options) do |td|
60
+ yield td if block_given?()
61
+ # We have to map the columns to check if we have to change the type
62
+ td.columns.each do |col|
63
+ if col.options[:limit] && col.type == :integer
64
+ col.type = :bigint
65
+ end
66
+ end
67
+ end
61
68
  if options[:sequence] != false && options[:id] != false
62
69
  sequence_name = options[:sequence] || default_sequence_name(table_name)
63
70
  create_sequence(sequence_name)
@@ -131,6 +131,14 @@ module ActiveRecord
131
131
  @connection.columns(table_name)
132
132
  end
133
133
 
134
+ def integer_like_primary_key_type(type, options)
135
+ if type == :bigint || options[:limit] == 8
136
+ :bigint
137
+ else
138
+ :int
139
+ end
140
+ end
141
+
134
142
  def new_column_from_field(table_name, field)
135
143
  type_metadata = fetch_type_metadata(field["sql_type"], field)
136
144
  ActiveRecord::ConnectionAdapters::ArFirebird::FbColumn.new(
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.4
4
+ version: 1.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Fábio Rodrigues
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2020-02-04 00:00:00.000000000 Z
12
+ date: 2020-04-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: fb
@@ -152,7 +152,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
152
152
  - !ruby/object:Gem::Version
153
153
  version: '0'
154
154
  requirements: []
155
- rubygems_version: 3.0.3
155
+ rubyforge_project:
156
+ rubygems_version: 2.7.6
156
157
  signing_key:
157
158
  specification_version: 4
158
159
  summary: ActiveRecord Firebird Adapter for Rails 5 and 6.