Giter Club home page Giter Club logo

django-reset-migrations's People

Contributors

desertsniper87 avatar funkotron avatar jtrain avatar khanmaytok avatar pv8 avatar ssaornil avatar valdergallo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar

django-reset-migrations's Issues

Cyrillic file content error

When I've executed command
python manage.py reset_migrations treasure
I've got error:

Traceback (most recent call last):
File "manage.py", line 15, in
execute_from_command_line(sys.argv)
File "C:\Python37\lib\site-packages\django\core\management_init_.py", line 381, in execute_from_command_line
utility.execute()
File "C:\Python37\lib\site-packages\django\core\management_init_.py", line 375, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "C:\Python37\lib\site-packages\django\core\management\base.py", line 316, in run_from_argv
self.execute(*args, **cmd_options)
File "C:\Python37\lib\site-packages\django\core\management\base.py", line 353, in execute
output = self.handle(*args, **options)
File "C:\Python37\lib\site-packages\reset_migrations\management\commands\reset_migrations.py", line 74, in handle
self.delete_dependence_app(app)
File "C:\Python37\lib\site-packages\reset_migrations\management\commands\reset_migrations.py", line 65, in delete_dependence_app
delete_line(file_name, regex, self.stdout)
File "C:\Python37\lib\site-packages\reset_migrations\management\commands\reset_migrations.py", line 13, in delete_line
for line in src_file:
File "C:\Python37\lib\encodings\cp1251.py", line 24, in decode
return codecs.charmap_decode(input,self.errors,decoding_table)[0]
UnicodeDecodeError: 'charmap' codec can't decode byte 0x98 in position 1624: character maps to

I suggest reason is cyrillic symbols in my project files.

Thank you!

Dependency error

Resetting voucher from https://github.com/django-oscar/django-oscar caused an error - it has a problem with the dependency app basket.

Reseting APP ['voucher']
Deleting APP (voucher) in database
Deleting APP (voucher) migrations files
Deleting dependences in migrations for (voucher)
APP (voucher) deleted with success
Traceback (most recent call last):
  File "./manage.py", line 46, in <module>
    main()
  File "./manage.py", line 42, in main
    execute_from_command_line(sys.argv)
  File "/usr/lib/python3.8/site-packages/django/core/management/__init__.py", line 401, in execute_from_command_line
    utility.execute()
  File "/usr/lib/python3.8/site-packages/django/core/management/__init__.py", line 395, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python3.8/site-packages/django/core/management/base.py", line 328, in run_from_argv
    self.execute(*args, **cmd_options)
  File "/usr/lib/python3.8/site-packages/django/core/management/base.py", line 369, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python3.8/site-packages/reset_migrations/management/commands/reset_migrations.py", line 78, in handle
    call_command('makemigrations', *apps)
  File "/usr/lib/python3.8/site-packages/django/core/management/__init__.py", line 168, in call_command
    return command.execute(*args, **defaults)
  File "/usr/lib/python3.8/site-packages/django/core/management/base.py", line 369, in execute
    output = self.handle(*args, **options)
  File "/usr/lib/python3.8/site-packages/django/core/management/base.py", line 83, in wrapped
    res = handle_func(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/django/core/management/commands/makemigrations.py", line 101, in handle
    loader.check_consistent_history(connection)
  File "/usr/lib/python3.8/site-packages/django/db/migrations/loader.py", line 295, in check_consistent_history
    raise InconsistentMigrationHistory(
django.db.migrations.exceptions.InconsistentMigrationHistory: Migration basket.0003_basket_vouchers is applied before its dependency voucher.0001_initial on database 'default'.

Error line 17

Hi Man,
I'm trying to use your script and after run
python manage.py reset_migrations app1 app2 app3...
I got this
..../reset_migrations.py", line 17, in delete_line
print_function('Deleting line in %s' % filename)
AttributeError: _Feature instance has no call method

Do you have any idea what's going on?
***My apps has dependencies

thanks in advance :)

Typos in README.MD

It's a very minor issue, but I notice two typos in README.MD.

There are a couple of references to "INSTALL_APPS" but they should say "INSTALLED_APPS".

I realize most people already would already know what it should say, but there might be newbies who take the instruction literally.

Option to drop tables and apply new (reset, initial) migration

Love this.

Would be even better with an option to drop the tables that it just reset and apply the new initial migration.

It may want an "Are you sure?" prompt to minimize risk of accidents and a -y or -f option to to answer yes automatically or force that (for scripts).

This is admittedly for a particular use case at the outset of a project when models are evolving rapidly and there is no live data yet per se, and whatever data is in there is from initial and test fixtures and easy to reload anyhow.

This extra feature would bring this use case into its one command turn-key solution scope. And would rock.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.