Skip to content

Commit db8a2d5

Browse files
committed
fix: Fix compilation error with DDL function grouping
1 parent 77b9f17 commit db8a2d5

1 file changed

Lines changed: 12 additions & 12 deletions

File tree

lib/ecto/adapters/libsql/connection.ex

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)