diff options
author | Olly Cope <olly@ollycope.com> | 2021-05-02 14:45:48 +0000 |
---|---|---|
committer | Olly Cope <olly@ollycope.com> | 2021-05-02 14:45:48 +0000 |
commit | 23bf2b84b837d3e17fd9f82f254227577e368879 (patch) | |
tree | a135a970f444b0bc0319424008bb6a505a1765e6 | |
parent | 598f5a85095fe918531c91c75a670cdd497bd8dd (diff) | |
download | yoyo-23bf2b84b837d3e17fd9f82f254227577e368879.tar.gz |
read_migrations: sort migrations when a glob pattern source is passed
-rwxr-xr-x | yoyo/migrations.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/yoyo/migrations.py b/yoyo/migrations.py index 6ed4476..96a74d7 100755 --- a/yoyo/migrations.py +++ b/yoyo/migrations.py @@ -477,10 +477,10 @@ def _expand_sources(sources) -> Iterable[Tuple[str, List[str]]]: for directory in glob(source): paths = [ os.path.join(directory, path) - for path in sorted(os.listdir(directory)) + for path in os.listdir(directory) if _is_migration_file(path) ] - yield (directory, paths) + yield (directory, sorted(paths)) def read_migrations(*sources): |