Migrations - Questions

Hi,

I have a question regarding the migrations in Django. Very often, when I update my models I often have bugs as some compulsory values must be initialized first. I end up opening my sqliteDB with a DB browser, and create some new entries myself before migrating.

those values can be initialized fairly easily with a procedure.

I am wondering, is it possible to “makemigrations” then include a script inside the migration file before migrating?

This would be useful while syncing with github across several clients, people just need to migrate for updating their SqliteDB.

thank you for your support,

Tibibs

You can modify an existing migration, or you can create a migration of your own. (See How to create database migrations | Django documentation | Django)

Also see Migration Operations | Django documentation | Django.

Hi Ken,

thank’s a lot, very interesting reading and really opening possibilities.

I am getting a bit more knowledgeable every day.

Thank’s,

Tibibs