Skip to content
This repository has been archived by the owner on Mar 15, 2018. It is now read-only.

Commit

Permalink
bail if no ids
Browse files Browse the repository at this point in the history
  • Loading branch information
Andy McKay committed Jun 5, 2012
1 parent 9816f65 commit d58a383
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions migrations/417-migrate-logs.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,9 @@ def run():
ids = [r[0] for r in cursor.fetchall()]

cursor.execute('set foreign_key_checks = 0')
if not ids:
return

cursor.execute('insert into log_activity_mkt '
'select * from log_activity where id IN %(ids)s;',
{'ids':ids})
Expand Down

0 comments on commit d58a383

Please sign in to comment.