Skip to content
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: error when there is __init__.py in the migration folder #272

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from

Conversation

LanceMoe
Copy link

No description provided.

@LanceMoe
Copy link
Author

Aerich changed from sql to py source code. When there is __init__.py in the migration folder, aerich will report an error. This PR fixes the issue.

@@ -50,7 +50,7 @@ class Migrate:
@classmethod
def get_all_version_files(cls) -> List[str]:
return sorted(
filter(lambda x: x.endswith("py"), os.listdir(cls.migrate_location)),
filter(lambda x: x.endswith("py") and not x.startswith("__"), os.listdir(cls.migrate_location)),
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of this approach. Why dont we do x.startswith('__init__').

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for your review, I have edited it, please check again.

Copy link

@baseplate-admin baseplate-admin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

私のアドバイスを聞いてくれてありがとう

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants