Git Product home page Git Product logo

Comments (6)

dennissiemensma avatar dennissiemensma commented on July 17, 2024

I will only squash dsmr_stats, reducing 16 migrations (files) to just a single one.

It also renders all runPython migrations obsolete, as Django will run the old migrations for checkouts halfway migrated and the squashed ones for new checkouts.

from dsmr-reader.

dennissiemensma avatar dennissiemensma commented on July 17, 2024

I will also drop any prints in legacy migration, as they are deployed everywhere by now. RunPython-migrations will be dropped completely in the squashed version, because they only fix existing data.

from dsmr-reader.

dennissiemensma avatar dennissiemensma commented on July 17, 2024
  • ./manage.py squashmigrations dsmr_consumption 0004_recalculate_gas_consumption
  • ./manage.py squashmigrations dsmr_datalogger 0005_optional_gas_readings
  • ./manage.py squashmigrations dsmr_stats 0016_drop_stats_settings

Added a runpython for database init of MeterStatistics.objects.create().

from dsmr-reader.

dennissiemensma avatar dennissiemensma commented on July 17, 2024

I think I'm running into a migration bug in Django, but I'm not sure. It seems index operations for MySQL and PostgreSQL do not respect the operation order. When a squashed migration ends up having this:

  • Create model
  • Add field with index
  • Drop model

Then the creation of the index is delayed after dropping the model, which is denied by the database. Only SQLite seems unaffected.

from dsmr-reader.

dennissiemensma avatar dennissiemensma commented on July 17, 2024

Seems related to:

I think the reason behind is that squashmigrations doesn't remove the model from the migrations. It shouldn't exist at all.

Fow now I will fix it manually by dropping db_index=True attribute of the model created and dropped later.

from dsmr-reader.

dennissiemensma avatar dennissiemensma commented on July 17, 2024

Merged & deployed.

from dsmr-reader.

Related Issues (20)

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.