Re: Migrations for multiple Django versions

2016-11-26 Thread Vlastimil Zíma
According the documentation, migrations should be backwards compatible, see https://docs.djangoproject.com/en/1.9/topics/migrations/#supporting-multiple-django-versions. Hence there shouldn't be any reason to make different versions of any application for different versions of Django. Also I ca

Re: Migrations for multiple Django versions

2016-11-25 Thread Dan Tagg
Hi Vlastimil, Why not use your source control system to publish different releases for different versions of django. Dan On 25 November 2016 at 10:01, Vlastimil Zíma wrote: > I don't think separate migrations would make the problem any better, that > looks just like more complicated implementa

Re: Migrations for multiple Django versions

2016-11-25 Thread Vlastimil Zíma
I don't think separate migrations would make the problem any better, that looks just like more complicated implementation of migrations with condition in it. Our use case: Our webs consist from several projects based on Django, with dependencies between them. One of the core projects provides,

Re: Migrations for multiple Django versions

2016-11-24 Thread Tim Graham
I'm not sure. Possibly you could hack up a solution with separate migration directories for each Django version you want to support, e.g. migrations_dj19, migrations_dj18, ... and then point to the correct directory with settings.MIGRATION_MODULES. I'm doubtful if that can be done elegantly whe

Re: Migrations for multiple Django versions

2016-11-24 Thread Vlastimil Zíma
We find out migrations with condition on Django version doesn't work. Let's have migrations based on Django version for user last_login: 1. Create database 2. Run migrations in Django 1.7 - that correctly creates table custom_user with last_login NOT NULL 3. Update Django to 1.9 4. Run migrat

Re: Migrations for multiple Django versions

2016-10-20 Thread Vlastimil Zíma
Is that an official solution for migrations based on Django version? Probably works, but it doesn't look like a nice solution. Regards, Vlastimil Dne středa 19. října 2016 1:57:25 UTC+2 Tim Graham napsal(a): > > Assuming the problem is makemigrations generating different migrations > based on t

Re: Migrations for multiple Django versions

2016-10-18 Thread Tim Graham
Assuming the problem is makemigrations generating different migrations based on the Django version, conditionally adding operations in migrations with some django.VERSION checks may help. On Tuesday, October 18, 2016 at 7:12:02 AM UTC-4, Vlastimil Zíma wrote: > > Hi everyone, > > we are trying i

Migrations for multiple Django versions

2016-10-18 Thread Vlastimil Zíma
Hi everyone, we are trying in our application to support multiple Django versions, specifically 1.7 to 1.9. But we encountered a problem with `User.last_login` field. We use custom User model based on `AbstractBaseUser` as specified by the documentation. Everything was fine in Django 1.7, but