1
1
mirror of https://github.com/yandex/pgmigrate.git synced 2024-09-17 15:17:18 +03:00

Add warning message on skipped migration files and document migration file format in tutorial

This change is based on proposal by Ernst Haagsman
This commit is contained in:
secwall 2017-12-02 22:02:44 +03:00
parent 76c828baf9
commit bab18b983d
2 changed files with 12 additions and 0 deletions

View File

@ -19,6 +19,15 @@ foodb
Every sql file has special operation on table `ops`.
This will help in understanding what is going on in each pgmigrate run.
## Migration file name pattern
All migration files should have versions and
names in the following format
```
V<version>__<description>.sql
```
Note: files not matching this pattern will be skipped.
## Creating `foo` user and `foodb`
We'll need dummy user and database for our experiments.

View File

@ -167,6 +167,9 @@ def _get_migrations_info_from_dir(base_dir):
continue
match = MIGRATION_FILE_RE.match(fname)
if match is None:
LOG.warning(
'File %s does not match by pattern %s. Skipping it.',
file_path, MIGRATION_FILE_RE.pattern)
continue
version = int(match.group('version'))
ret = dict(