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 - Writte 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
- migration = open('easy-migration.sql','w')
- migration.write(build_query(path))
- migration.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement