-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
structured migration options #116
Conversation
@@ -2065,6 +2102,10 @@ defmodule Ecto.Adapters.ClickHouse.ConnectionTest do | |||
] | |||
end | |||
|
|||
# TODO? | |||
@tag :skip | |||
test "drop constraint on cluster" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://hexdocs.pm/ecto_sql/Ecto.Migration.Constraint.html doesn't have :options
field. We can hack around and pass cluster in :comment
though :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We can also open a PR into Ecto to add constraint.options
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm relatively new to ClickHouse, so maybe I'm just not fully aware, but according to the docs, constraints are created and dropped using ALTER TABLE
statements https://clickhouse.com/docs/en/sql-reference/statements/alter/constraint
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, but that's not the issue. The issue is that we we can't pass any :options
to https://hexdocs.pm/ecto_sql/Ecto.Migration.html#constraint/3
9fc41b8
to
a3dee69
Compare
a3dee69
to
7720530
Compare
```elixir | ||
table_options = [cluster: "my-cluster"] | ||
engine_options = [order_by: "tuple()"] | ||
optiosn = table_options ++ engine_options |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
options
(spelling)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
😅
@ruslandoga this looks great! |
This PR attempts to add structured migration options as proposed in #115 (comment)