Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # -*- coding: UTF-8 -*-
- import os
- path = os.getcwd()
- def build_query(path):
- migration = '#Eeasy Migration Tool - Write all the querys \n'
- for path, subdirs, files in os.walk(path):
- for file in files:
- if file.endswith('.sql'):
- sql_file = os.path.join(path, file)
- migration += open(sql_file).read() + '\n'
- migration += '\n # Consider yourself migrated (⌐■_■)'
- return migration
- try:
- migration = open('easy-migration.sql', 'w')
- migration.write(build_query(path))
- migration.close()
- print('ᕦ(ò_óˇ)ᕤ easy-migration.sql was created successfully')
- except:
- print('(>人<) Ooops, there\'s something wrong')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement