-
Notifications
You must be signed in to change notification settings - Fork 51
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
Disable supports_expression_index unconditionally #250
Disable supports_expression_index unconditionally #250
Conversation
@@ -181,7 +181,10 @@ def supports_partial_index? | |||
end | |||
|
|||
def supports_expression_index? | |||
@crdb_version >= 2122 | |||
# Expression indexes are partially supported by CockroachDB v21.2, |
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.
if we do support it partially, then i would argue we should skip the test instead, or add a new condition for ON CONFLICT
support and use that to skip the test / anything relevant in the ORM
otherwise, is this is a "regression" in ORM behaviour?
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.
Moved this to disable supports_insert_conflict_target?
instead.
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 didn't need the public_send
stuff right?
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.
It looks like it is already there for the ones I overrode.
%w[
supports_savepoints?
supports_partial_index?
supports_partitioned_indexes?
supports_expression_index?
supports_insert_returning?
supports_insert_on_duplicate_skip?
supports_insert_on_duplicate_update?
supports_insert_conflict_target?
supports_optimizer_hints?
supports_datetime_with_precision?
].each do |method_name|
define_method method_name do
ActiveRecord::Base.connection.public_send(method_name)
end
end
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.
does this mean it will also disable ON CONFLICT column_name
?
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.
Yeah it looks like there is no way to say we support expression indexes and ON CONFLICT column_name
, but not ON CONFLICT expression
without modifying activerecord itself.
hmm, this failure seems suspicious |
Yeah it looks like I also had to disable However |
fixes cockroachdb/cockroach#67893 fixes cockroachdb/cockroach#80777 These can be enabled when CockroachDB supports "ON CONFLICT expression". refs cockroachdb/cockroach#67893
fixes cockroachdb/cockroach#67893
fixes cockroachdb/cockroach#80777
These can be enabled when CockroachDB supports "ON CONFLICT expression"
refs cockroachdb/cockroach#67893