code: def get_migration_files(self):
          
          migrations = (re.match(MigrationFile.PATTERN, filename)
                        for filename in os.listdir(self.directory))
          migrations = (MigrationFile(m.group('id'), m.group(0))
                        for m in migrations if m)
          return sorted(migrations, key=lambda m: m.id)
docs: Find migrations files.