summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIgor Tsarev <iam@tio.so>2015-11-13 17:57:31 +0300
committerIgor Tsarev <iam@tio.so>2015-11-13 17:57:31 +0300
commitbe574e70a312756624375498f11af89e1128699e (patch)
treed42bad8c5cf39d88f5daa2923828595cf724bc0b
parentc982627b6a09d6778bb311e3ab04633c2ec470b8 (diff)
downloadyoyo-be574e70a312756624375498f11af89e1128699e.tar.gz
Fixed number(in file name) of new migrations when prefix defined in config
-rw-r--r--yoyo/scripts/newmigration.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/yoyo/scripts/newmigration.py b/yoyo/scripts/newmigration.py
index c430591..7e7c36b 100644
--- a/yoyo/scripts/newmigration.py
+++ b/yoyo/scripts/newmigration.py
@@ -131,8 +131,8 @@ def make_filename(config, directory, message):
except configparser.NoOptionError:
prefix = ''
- for p in glob.glob(path.join(directory, '{}_*'.format(datestr))):
- n = path.basename(p)[len(datestr) + 1:].split('_')[0]
+ for p in glob.glob(path.join(directory, '{}{}_*'.format(prefix, datestr))):
+ n = path.basename(p)[len(prefix) + len(datestr) + 1:].split('_')[0]
try:
if number <= n: