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:
parent
76c828baf9
commit
bab18b983d
@ -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.
|
||||
|
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user