activerecord-trilogis-adapter 8.1.0 → 8.1.1

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: 1c43e31eb6d57d6b2eaf0ed551c13c729e1a7366e71f368871e358f262c6acac
4
- data.tar.gz: 53488d879dd78083bc5671f5067a9b357a4f453213e2df373c9cf0e321542c6e
3
+ metadata.gz: 30266da053b3f001b74a6f0fcbcfffe26b11a0205f1e1a2164584f53b995bc21
4
+ data.tar.gz: ea5ca2afb3df8e11d9697cecb5e1ef5e06209158d1db3178c111c1a3f3aafb9d
5
5
  SHA512:
6
- metadata.gz: 384a3d95ec59d189d0615d2571498a0d7c7feff5f65862fd166f14d468eefd73c67fbc89072574b32aafebb1c36a79570f3221a8878f9b0272016a06f784eceb
7
- data.tar.gz: d87c990d357629fb81929572fb4feedafae6dce63e7eb78be41552bc0d1f22f41a8ccc98c21327ac96060180d49349ad8a78fdb2b52b817d1f97c9243b10076a
6
+ metadata.gz: 3cd09501502ce9bd8dd42ddbee0e27c88f4285a6c6d9df63cef047e31f1bfa8e6e89aee123c58190b20e089c26a0c5122ff841258d1a6d4b35fec58363bfb523
7
+ data.tar.gz: ef2a9ed811ce28e493d41a5fcd5bebb8ae7b9a4f34400b80ac80e02cf1f6149d288de532e2133a84a93d21aa757704752f0d5a9cfe125624e399f3d617a38db7
@@ -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
 
@@ -174,10 +175,10 @@ module ActiveRecord
174
175
  SpatialColumn.new(
175
176
  field_name,
176
177
  cast_type,
177
- extract_field_value(field, :Default, :default),
178
+ nil, # MySQL spatial columns cannot have DEFAULT values
178
179
  type_metadata,
179
180
  extract_field_value(field, :Null, :null) == "YES",
180
- extract_field_value(field, :Extra, :extra),
181
+ nil, # MySQL spatial columns cannot have DEFAULT functions
181
182
  collation: extract_field_value(field, :Collation, :collation),
182
183
  comment: extract_field_value(field, :Comment, :comment).presence,
183
184
  spatial_info: spatial_info
@@ -197,7 +198,10 @@ module ActiveRecord
197
198
  column_sql_parts << " SRID #{o.options[:srid]}" if o.options[:srid] && o.options[:srid] != 0
198
199
 
199
200
  column_sql_parts << " NOT NULL" unless o.null
200
- column_sql_parts << " DEFAULT #{quote_default_expression(o.default, o)}" unless o.default.nil?
201
+
202
+ # MySQL does not support DEFAULT values for spatial/geometry columns
203
+ # Silently ignore default to prevent SQL syntax errors
204
+
201
205
  column_sql_parts.join
202
206
  else
203
207
  super
@@ -88,6 +88,26 @@ module ActiveRecord
88
88
  # Type information is in the type() method
89
89
  { srid: @srid }.compact
90
90
  end
91
+
92
+ # Override default to always return nil for spatial columns
93
+ # MySQL does not support DEFAULT values for spatial/geometry columns
94
+ def default
95
+ return super unless spatial?
96
+
97
+ # Always return nil for spatial columns to prevent schema dumper
98
+ # from generating invalid DEFAULT clauses
99
+ nil
100
+ end
101
+
102
+ # Override default_function to always return nil for spatial columns
103
+ # MySQL does not support DEFAULT values for spatial/geometry columns
104
+ def default_function
105
+ return super unless spatial?
106
+
107
+ # Always return nil for spatial columns to prevent schema dumper
108
+ # from generating invalid DEFAULT clauses
109
+ nil
110
+ end
91
111
  end
92
112
  end
93
113
  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.1.1"
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.1.0
4
+ version: 8.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ether Moon