django-reset-migrations | Add one command to reset the django migrations | Data Migration library

 by   valdergallo Python Version: 0.4.0 License: Apache-2.0

kandi X-RAY | django-reset-migrations Summary

kandi X-RAY | django-reset-migrations Summary

django-reset-migrations is a Python library typically used in Migration, Data Migration, MongoDB, Boilerplate applications. django-reset-migrations has no bugs, it has no vulnerabilities, it has build file available, it has a Permissive License and it has low support. You can download it from GitHub.

Add one command to reset the django migrations. Sometimes you have one app that had a lot migrations in development process. And this migrations could be deleted, because anybody will need this in the future. Soo, could be stressfull delete the files, reset the database and create the first migration again ... to start to developer again and bla bla bla ... Because this, I made this command to reset the migrations and start the first migration. I hope be usefull to you 2 :D.
Support
    Quality
      Security
        License
          Reuse

            kandi-support Support

              django-reset-migrations has a low active ecosystem.
              It has 79 star(s) with 20 fork(s). There are no watchers for this library.
              OutlinedDot
              It had no major release in the last 12 months.
              There are 3 open issues and 5 have been closed. On average issues are closed in 550 days. There are no pull requests.
              It has a neutral sentiment in the developer community.
              The latest version of django-reset-migrations is 0.4.0

            kandi-Quality Quality

              django-reset-migrations has 0 bugs and 0 code smells.

            kandi-Security Security

              django-reset-migrations has no vulnerabilities reported, and its dependent libraries have no vulnerabilities reported.
              django-reset-migrations code analysis shows 0 unresolved vulnerabilities.
              There are 0 security hotspots that need review.

            kandi-License License

              django-reset-migrations is licensed under the Apache-2.0 License. This license is Permissive.
              Permissive licenses have the least restrictions, and you can use them in most projects.

            kandi-Reuse Reuse

              django-reset-migrations releases are available to install and integrate.
              Build file is available. You can build the component from source.
              Installation instructions, examples and code snippets are available.
              django-reset-migrations saves you 38 person hours of effort in developing the same functionality from scratch.
              It has 103 lines of code, 8 functions and 5 files.
              It has high code complexity. Code complexity directly impacts maintainability of the code.

            Top functions reviewed by kandi - BETA

            kandi has reviewed django-reset-migrations and discovered the below as its top functions. This is intended to give you an instant insight into django-reset-migrations implemented functionality, and help decide if they suit your requirements.
            • Delete all apps
            • Delete dependences in migrations
            • Delete a line from filename
            • Delete migrations files
            • Delete an app from the database
            • Return the README file
            Get all kandi verified functions for this library.

            django-reset-migrations Key Features

            No Key Features are available at this moment for django-reset-migrations.

            django-reset-migrations Examples and Code Snippets

            No Code Snippets are available at this moment for django-reset-migrations.

            Community Discussions

            Trending Discussions on django-reset-migrations

            QUESTION

            Create or Alter PostgreSQL Table to ensure Django Models match
            Asked 2018-Nov-16 at 10:53

            I ran into an annoying issue today during the development of a Django project where I was attempting to move between a testing database and a development database, and I cannot seem to figure out a solid way to go about fixing issues with migrations.

            Let's call my 'test' DB: testDB and my 'dev' DB: devDB

            I was accessing testDB as usual through Django settings.py and I made migrations adding the clientID field you see in the code below.

            Then, I decided to swap to devDB in my Django's settings.py to run python manage.py migrate, and my clientID field is not added to the new DB. When I run python manage.py makemigrations I get, as expected, "no changes detected".

            Just so this is noted, I am using the django-reset-migrations package from PyPi after I make migrations so the migrations folder does not get complicated and everything is stored in a single 0001_initial.py migrations file.

            I am not seeing a better way to handle this issue than by writing my own script that ensures all Model tables exist in whatever DB I am connected to, and that all Model fields are located in each table, else the table is altered and the appropriate columns are added, which brings me to my question...

            If I use: python manage.py sqlmigrate objects 0001 (which is my 0001_initial.py file), I am presented with the creation code below:

            ...

            ANSWER

            Answered 2018-Nov-16 at 10:53

            Just so this is noted, I am using the django-reset-migrations package from PyPi after I make migrations so the migrations folder does not get complicated and everything is stored in a single 0001_initial.py migrations file.

            The solution to your problem is simple: stop doing this.

            Resetting migration files in that way is an advanced, potentially dangerous technique. It's never required, but might be helpful in some circumstances. The migrations folder "getting complicated" is not a real problem that needs to be solved, especially for a beginning project.

            What makes it dangerous is that, by design, it's erasing the history of changes made to your models and database. So if you run it when a database is not fully updated—as you've apparently done—you've deleted the information necessary to do so. (Specifically, when you reset the migrations before migrating your dev database you deleted the file that specifies how to add the new column.)

            Source https://stackoverflow.com/questions/53328962

            Community Discussions, Code Snippets contain sources that include Stack Exchange Network

            Vulnerabilities

            No vulnerabilities reported

            Install django-reset-migrations

            Install package in your INSTALLED_APPS.

            Support

            For any new features, suggestions and bugs create an issue on GitHub. If you have any questions check and ask questions on community page Stack Overflow .
            Find more information at:

            Find, review, and download reusable Libraries, Code Snippets, Cloud APIs from over 650 million Knowledge Items

            Find more libraries
            CLONE
          • HTTPS

            https://github.com/valdergallo/django-reset-migrations.git

          • CLI

            gh repo clone valdergallo/django-reset-migrations

          • sshUrl

            git@github.com:valdergallo/django-reset-migrations.git

          • Stay Updated

            Subscribe to our newsletter for trending solutions and developer bootcamps

            Agree to Sign up and Terms & Conditions

            Share this Page

            share link

            Consider Popular Data Migration Libraries

            Try Top Libraries by valdergallo

            digitalocean-ubuntu-fabric

            by valdergalloPython

            data-importer

            by valdergalloPython

            django-compress-field

            by valdergalloPython

            django-choices-flow

            by valdergalloPython

            pyconst

            by valdergalloPython