Advertisement
Guest User

Untitled

a guest
Jun 24th, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.54 KB | None | 0 0
  1. # -*- coding: UTF-8 -*-
  2. import os
  3.  
  4. path = os.getcwd()
  5.  
  6. def build_query(path):
  7. migration = '#Eeasy Migration Tool - Writte all the querys \n'
  8. for path, subdirs, files in os.walk(path):
  9. for file in files:
  10. if file.endswith('.sql'):
  11. sql_file = os.path.join(path, file)
  12. migration += open(sql_file).read() + '\n'
  13. migration += '\n # Consider yourself migrated (⌐■_■)'
  14. return migration
  15.  
  16. migration = open('easy-migration.sql','w')
  17. migration.write(build_query(path))
  18. migration.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement