@@ -158,18 +158,6 @@ defmodule Ecto.Adapters.LibSql.Connection do
158158 end )
159159 end
160160
161- defp alter_column_definition ( name , % Ecto.Migration.Reference { } = ref , opts ) do
162- base_type = column_type ( ref . type , [ ] )
163- references = reference_expr ( ref )
164- # For ALTER COLUMN, we construct: column_name new_type [constraints] [references].
165- "#{ quote_name ( name ) } TO #{ quote_name ( name ) } #{ base_type } #{ column_options ( opts , false ) } #{ references } "
166- end
167-
168- defp alter_column_definition ( name , type , opts ) do
169- # For ALTER COLUMN, we construct: column_name TO column_name new_type [constraints].
170- "#{ quote_name ( name ) } TO #{ quote_name ( name ) } #{ column_type ( type , opts ) } #{ column_options ( opts , false ) } "
171- end
172-
173161 def execute_ddl ( { :create , % Ecto.Migration.Index { } = index } ) do
174162 fields = Enum . map_join ( index . columns , ", " , & quote_name / 1 )
175163 table_name = quote_table ( index . prefix , index . table )
@@ -221,6 +209,18 @@ defmodule Ecto.Adapters.LibSql.Connection do
221209
222210 ## DDL Helpers
223211
212+ defp alter_column_definition ( name , % Ecto.Migration.Reference { } = ref , opts ) do
213+ base_type = column_type ( ref . type , [ ] )
214+ references = reference_expr ( ref )
215+ # For ALTER COLUMN, we construct: column_name TO column_name new_type [constraints] [references].
216+ "#{ quote_name ( name ) } TO #{ quote_name ( name ) } #{ base_type } #{ column_options ( opts , false ) } #{ references } "
217+ end
218+
219+ defp alter_column_definition ( name , type , opts ) do
220+ # For ALTER COLUMN, we construct: column_name TO column_name new_type [constraints].
221+ "#{ quote_name ( name ) } TO #{ quote_name ( name ) } #{ column_type ( type , opts ) } #{ column_options ( opts , false ) } "
222+ end
223+
224224 defp composite_primary_key? ( columns ) do
225225 pk_count =
226226 Enum . count ( columns , fn { :add , _name , _type , opts } ->
0 commit comments