Skip to content

Commit

Permalink
using full paths so it works when called outside the migration dir
Browse files Browse the repository at this point in the history
  • Loading branch information
jbalogh committed May 25, 2009
1 parent d183b40 commit 1b2561a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions schematic.py
Original file line number Diff line number Diff line change
Expand Up @@ -141,10 +141,11 @@ def table_check(db, table):


def find_upgrades():
files = [p for p in os.listdir(ROOT) if os.path.isfile(p)]
fullpath = lambda p: os.path.join(ROOT, p)
files = [p for p in map(fullpath, os.listdir(ROOT)) if os.path.isfile(p)]
upgrades = {}
for f in files:
m = re.match('^(\d+)', f)
m = re.match('^(\d+)', os.path.basename(f))
if m:
upgrades[int(m.group(0))] = f
return upgrades
Expand Down

0 comments on commit 1b2561a

Please sign in to comment.