activerecord-trilogis-adapter 8.0.1 → 8.0.2

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
  SHA256:
3
- metadata.gz: c50e53fc7f5c471c74e8f587e0c0bdab734181845cd438359537735cc1adbe19
4
- data.tar.gz: 930f29abad6e57fbbbe3d6e922a191c21cbb75365ef99233633e728a4e4b8b0e
3
+ metadata.gz: c62868490c8dbbca1486797b7f451fe16da47e250d97d9578bc28bd405f88979
4
+ data.tar.gz: 53635558156147dadcf07913b4faeec937b0c8d1fd09548a82ac8168d10c3c45
5
5
  SHA512:
6
- metadata.gz: 8c504d937064d0ffbd6a57a4c6bb854db79436d1e6b9f933e138aeaf155e769316a54f77a37fe1ca1c704e3c30dd4f7a519559e355ca3159533b21fd3cd1c694
7
- data.tar.gz: 2cafe377ca75657049c47678ad97eb41d74f1990b96aaa859820822aa4c7aa5d32c50fb555b0c7d0f6958e0a5d91ff0d9eaa9e9b6aec4f7dc9c8fe788ef7905c
6
+ metadata.gz: 12824854fd79269b2f00231712267db378e642579ea462a2aee7c1e377961ee65a0f03d2d47227484b9bfaa1800549fa2b207c7e8c5e29d9b1059b7deafed4bd
7
+ data.tar.gz: 1bb9c83957682886cb09eb343fe82ef2e9e9c2a4eb6998f01ecfe0d5c3c8a52659bfccd7344433260e1de3c66d15f8579ed2132286471fe9b9f235b042ef2b1e
@@ -12,6 +12,11 @@ module ActiveRecord
12
12
  if options[:srid]
13
13
  sql_result = "#{sql} /*!80003 SRID #{options[:srid]} */"
14
14
  sql.replace(sql_result)
15
+
16
+ # MySQL does not support DEFAULT values for spatial columns
17
+ # Remove :default option before calling super to prevent SQL errors
18
+ options = options.dup
19
+ options.delete(:default)
15
20
  end
16
21
 
17
22
  super
@@ -87,8 +87,9 @@ module ActiveRecord
87
87
  # Add NULL constraint
88
88
  sql_parts << " NOT NULL" if options[:null] == false
89
89
 
90
- # Add DEFAULT if specified (allow falsy values like 0/false)
91
- sql_parts << " DEFAULT #{quote_default_expression(options[:default], nil)}" if options.key?(:default)
90
+ # MySQL does not support DEFAULT values for spatial/geometry columns
91
+ # Silently ignore :default option to prevent SQL syntax errors
92
+ # Users should handle defaults at application level instead
92
93
 
93
94
  execute sql_parts.join
94
95
 
@@ -165,10 +166,10 @@ module ActiveRecord
165
166
 
166
167
  SpatialColumn.new(
167
168
  field_name,
168
- extract_field_value(field, :Default, :default),
169
+ nil, # MySQL spatial columns cannot have DEFAULT values
169
170
  type_metadata,
170
171
  extract_field_value(field, :Null, :null) == "YES",
171
- extract_field_value(field, :Extra, :extra),
172
+ nil, # MySQL spatial columns cannot have DEFAULT functions
172
173
  collation: extract_field_value(field, :Collation, :collation),
173
174
  comment: extract_field_value(field, :Comment, :comment).presence,
174
175
  spatial_info: spatial_info
@@ -188,7 +189,10 @@ module ActiveRecord
188
189
  column_sql_parts << " SRID #{o.options[:srid]}" if o.options[:srid] && o.options[:srid] != 0
189
190
 
190
191
  column_sql_parts << " NOT NULL" unless o.null
191
- column_sql_parts << " DEFAULT #{quote_default_expression(o.default, o)}" unless o.default.nil?
192
+
193
+ # MySQL does not support DEFAULT values for spatial/geometry columns
194
+ # Silently ignore default to prevent SQL syntax errors
195
+
192
196
  column_sql_parts.join
193
197
  else
194
198
  super
@@ -83,6 +83,26 @@ module ActiveRecord
83
83
  # Type information is in the type() method
84
84
  { srid: @srid }.compact
85
85
  end
86
+
87
+ # Override default to always return nil for spatial columns
88
+ # MySQL does not support DEFAULT values for spatial/geometry columns
89
+ def default
90
+ return super unless spatial?
91
+
92
+ # Always return nil for spatial columns to prevent schema dumper
93
+ # from generating invalid DEFAULT clauses
94
+ nil
95
+ end
96
+
97
+ # Override default_function to always return nil for spatial columns
98
+ # MySQL does not support DEFAULT values for spatial/geometry columns
99
+ def default_function
100
+ return super unless spatial?
101
+
102
+ # Always return nil for spatial columns to prevent schema dumper
103
+ # from generating invalid DEFAULT clauses
104
+ nil
105
+ end
86
106
  end
87
107
  end
88
108
  end
@@ -3,7 +3,7 @@
3
3
  module ActiveRecord
4
4
  module ConnectionAdapters
5
5
  module Trilogis
6
- VERSION = "8.0.0"
6
+ VERSION = "8.0.2"
7
7
  end
8
8
  end
9
9
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: activerecord-trilogis-adapter
3
3
  version: !ruby/object:Gem::Version
4
- version: 8.0.1
4
+ version: 8.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ether Moon