Commit 840ca83a authored by Rafal's avatar Rafal

add script

parent bef41bd4
#remove_migrations.py
"""
Run this file from a Django =1.7 project root.
Removes all migration files from all apps in a project.
"""
from unipath import Path
this_file = Path(__file__).absolute()
current_dir = this_file.parent
dir_list = current_dir.listdir()
for paths in dir_list:
migration_folder = paths.child('migrations')
if migration_folder.exists():
list_files = migration_folder.listdir()
for files in list_files:
split = files.components()
if split[-1] != Path('__init__.py'):
files.remove()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment