-
-
Notifications
You must be signed in to change notification settings - Fork 399
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
Fix index class argument name
not work
#1856
Fix index class argument name
not work
#1856
Conversation
CodSpeed Performance ReportMerging #1856 will not alter performanceComparing Summary
|
Pull Request Test Coverage Report for Build 12900145277Details
💛 - Coveralls |
@henadzit Shall we add class Index:
def index_name(self, schema_generator: "BaseSchemaGenerator", model: "Type[Model]") -> str:
return self.name or schema_generator._generate_index_name("idx", model, self.field_names)
def get_sql(self, schema_generator: "BaseSchemaGenerator", model: "Type[Model]", safe: bool) -> str:
return schema_generator._get_index_sql(
model, self.field_names, safe, index_name=self.name, index_type=self.INDEX_TYPE, extra=self.extra
) |
Thanks for fixing this!
I searched the aerich code base and seems to be used there - this is something that I didn't realize. We probably need to get it back. Let me know if you want to do it yourself or you want me to do it. If you decide to do it yourself, please, leave a comment in the code to note that it is needed for aerich. Thanks! |
…tor-generate-index-sql
@henadzit Cloud you review again. I added index_name/get_sql back and use index.get_sql in schema_generator. |
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.
LGTM!
Description
Argument
name
of Index class does not pass to the_get_index_sql
function when generating schemas.Motivation and Context
index.name
to_get_index_sql
field_names
property to Index classHow Has This Been Tested?
make ci
Checklist: