[Django] #22170: Add initial migrations for contrib apps

14 views
Skip to first unread message

Django

unread,
Feb 28, 2014, 9:14:26 AM2/28/14
to django-...@googlegroups.com
#22170: Add initial migrations for contrib apps
-------------------------------------------+------------------------
Reporter: timo | Owner:
Type: New feature | Status: new
Component: Migrations | Version: master
Severity: Release blocker | Keywords:
Triage Stage: Unreviewed | Has patch: 0
Needs documentation: 0 | Needs tests: 0
Patch needs improvement: 0 | Easy pickings: 0
UI/UX: 0 |
-------------------------------------------+------------------------
There was some discussion among the core devs about the possibility of
adding migrations for contrib apps in 1.7. I think the consensus was that
it would be safer to release 1.7 without any schema changes, but to
include the initial migrations for contrib apps to get people thinking
about them.

--
Ticket URL: <https://code.djangoproject.com/ticket/22170>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

Django

unread,
Mar 7, 2014, 1:27:21 PM3/7/14
to django-...@googlegroups.com
#22170: Add initial migrations for contrib apps
---------------------------------+----------------------------------------
Reporter: timo | Owner: andrewgodwin
Type: New feature | Status: assigned
Component: Migrations | Version: master
Severity: Release blocker | Resolution:

Keywords: | Triage Stage: Unreviewed
Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
---------------------------------+----------------------------------------
Changes (by andrewgodwin):

* owner: => andrewgodwin
* status: new => assigned


--
Ticket URL: <https://code.djangoproject.com/ticket/22170#comment:1>

Django

unread,
Mar 8, 2014, 4:51:51 PM3/8/14
to django-...@googlegroups.com
#22170: Add initial migrations for contrib apps
-----------------------------+------------------------------------

Reporter: timo | Owner:
Type: New feature | Status: new
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted

Has patch: 0 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------
Changes (by andrewgodwin):

* status: assigned => new
* owner: andrewgodwin =>
* severity: Release blocker => Normal
* stage: Unreviewed => Accepted


Comment:

I've had a go at this, and it's just too much to do before 1.7, and I
don't consider it a release blocker.

The main problem is the test suite; it heavily relies on some intricate
behaviours of the way models are created and the ordering of that, and
migrations changes just enough that large swathes of it fail. I've
attached the patch of my work so far for future reference when we come
back to this.

--
Ticket URL: <https://code.djangoproject.com/ticket/22170#comment:2>

Django

unread,
Apr 19, 2014, 8:39:48 AM4/19/14
to django-...@googlegroups.com
#22170: Add initial migrations for contrib apps
-----------------------------+------------------------------------

Reporter: timo | Owner:
Type: New feature | Status: new
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------
Changes (by claudep):

* has_patch: 0 => 1


Comment:

Tests pass, at least with SQLite and PostgreSQL. Main difficulty was to
have the auth tests run the migration for various custom user models.

https://github.com/django/django/pull/2590

--
Ticket URL: <https://code.djangoproject.com/ticket/22170#comment:3>

Django

unread,
May 1, 2014, 9:39:46 AM5/1/14
to django-...@googlegroups.com
#22170: Add initial migrations for contrib apps
-----------------------------+---------------------------------------------

Reporter: timo | Owner:
Type: New feature | Status: new
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Ready for checkin
Has patch: 1 | Needs documentation: 0

Needs tests: 0 | Patch needs improvement: 0
Easy pickings: 0 | UI/UX: 0
-----------------------------+---------------------------------------------
Changes (by timo):

* stage: Accepted => Ready for checkin


--
Ticket URL: <https://code.djangoproject.com/ticket/22170#comment:4>

Django

unread,
May 4, 2014, 2:27:33 PM5/4/14
to django-...@googlegroups.com
#22170: Add initial migrations for contrib apps
-----------------------------+------------------------------------

Reporter: timo | Owner:
Type: New feature | Status: new
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------
Changes (by claudep):

* needs_better_patch: 0 => 1
* stage: Ready for checkin => Accepted


Comment:

Back to accepted:
* Loïc suggested a workaround to the `initial.py` vs `0001_initial.py`
naming issue in auth.
* I must have forgotten to include the sessions migration
* A more serious issue I discovered is about the `auth` and
`MIGRATION_MODULES` hack in `runtests.py`:
if we include the `MIGRATION_MODULES` hack in `runtests.py` and don't
include `django.contrib.auth` in tested labels, the creation of the test
database fails because the `flush` command fails (`auth_customuser` table
missing).

--
Ticket URL: <https://code.djangoproject.com/ticket/22170#comment:5>

Django

unread,
May 4, 2014, 4:38:49 PM5/4/14
to django-...@googlegroups.com
#22170: Add initial migrations for contrib apps
-----------------------------+------------------------------------

Reporter: timo | Owner:
Type: New feature | Status: new
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------

Comment (by claudep):

I find the `auth` migration really hard to do right, if anyone feels like
doing it, please go ahead. I think it could be done independently of other
migrations. The difficulty lies in having two sets of migrations (one with
custom user for tests and one "normal") and playing nicely with
`runtests.py`, `migrate` and `flush`.

--
Ticket URL: <https://code.djangoproject.com/ticket/22170#comment:6>

Django

unread,
Jun 15, 2014, 7:29:18 PM6/15/14
to django-...@googlegroups.com
#22170: Add initial migrations for contrib apps
-----------------------------+------------------------------------

Reporter: timo | Owner:
Type: New feature | Status: new
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"ec6e2eac60be52f7a5979ebc29a64197f5a11174"]:
{{{
#!CommitTicketReference repository=""
revision="ec6e2eac60be52f7a5979ebc29a64197f5a11174"
Added database migration for contrib.sites.

refs #22170.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22170#comment:7>

Django

unread,
Jun 15, 2014, 8:08:12 PM6/15/14
to django-...@googlegroups.com
#22170: Add initial migrations for contrib apps
-----------------------------+------------------------------------

Reporter: timo | Owner:
Type: New feature | Status: new
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"7da16b99dfa72beb782467d3644467457e1c6145"]:
{{{
#!CommitTicketReference repository=""
revision="7da16b99dfa72beb782467d3644467457e1c6145"
Added database migration for contrib.flatpages.

refs #22170.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22170#comment:8>

Django

unread,
Jun 15, 2014, 8:22:57 PM6/15/14
to django-...@googlegroups.com
#22170: Add initial migrations for contrib apps
-----------------------------+------------------------------------

Reporter: timo | Owner:
Type: New feature | Status: new
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"d7576bb27ad2825814ed9909271d3f64cb0e2bc4"]:
{{{
#!CommitTicketReference repository=""
revision="d7576bb27ad2825814ed9909271d3f64cb0e2bc4"
Added database migration for contrib.redirects.

refs #22170.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22170#comment:9>

Django

unread,
Jun 15, 2014, 9:25:25 PM6/15/14
to django-...@googlegroups.com
#22170: Add initial migrations for contrib apps
-----------------------------+------------------------------------

Reporter: timo | Owner:
Type: New feature | Status: new
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"534d9f1e822ef49550c195a4e9493970781c4591"]:
{{{
#!CommitTicketReference repository=""
revision="534d9f1e822ef49550c195a4e9493970781c4591"
[1.7.x] Added database migration for contrib.sites.

refs #22170.

Backport of ec6e2eac60 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22170#comment:10>

Django

unread,
Jun 15, 2014, 9:25:25 PM6/15/14
to django-...@googlegroups.com
#22170: Add initial migrations for contrib apps
-----------------------------+------------------------------------

Reporter: timo | Owner:
Type: New feature | Status: new
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"380cafe5bee50d4cc9d90ef6e33e47be9de25e0b"]:
{{{
#!CommitTicketReference repository=""
revision="380cafe5bee50d4cc9d90ef6e33e47be9de25e0b"
[1.7.x] Added database migration for contrib.redirects.

refs #22170.

Backport of d7576bb27a from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22170#comment:12>

Django

unread,
Jun 15, 2014, 9:25:27 PM6/15/14
to django-...@googlegroups.com
#22170: Add initial migrations for contrib apps
-----------------------------+------------------------------------

Reporter: timo | Owner:
Type: New feature | Status: new
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"ec7cddd361c7e575397e067c5f0e0846c11a0b10"]:
{{{
#!CommitTicketReference repository=""
revision="ec7cddd361c7e575397e067c5f0e0846c11a0b10"
[1.7.x] Added database migration for contrib.flatpages.

refs #22170.

Backport of 7da16b99df from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22170#comment:11>

Django

unread,
Jun 16, 2014, 11:52:45 AM6/16/14
to django-...@googlegroups.com
#22170: Add initial migrations for contrib apps
-----------------------------+------------------------------------

Reporter: timo | Owner:
Type: New feature | Status: new
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"37a8f5aeedcfc5b4605960e5dc3d989456ce88b9"]:
{{{
#!CommitTicketReference repository=""
revision="37a8f5aeedcfc5b4605960e5dc3d989456ce88b9"
Added database migration for contrib.sessions.

refs #22170.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22170#comment:13>

Django

unread,
Jun 16, 2014, 11:54:14 AM6/16/14
to django-...@googlegroups.com
#22170: Add initial migrations for contrib apps
-----------------------------+------------------------------------

Reporter: timo | Owner:
Type: New feature | Status: new
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"a15bf2cd4e8f7279488f04aaf3040f420dc5f9cb"]:
{{{
#!CommitTicketReference repository=""
revision="a15bf2cd4e8f7279488f04aaf3040f420dc5f9cb"
[1.7.x] Added database migration for contrib.sessions.

refs #22170.

Backport of 37a8f5aeed from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22170#comment:14>

Django

unread,
Jun 16, 2014, 3:03:33 PM6/16/14
to django-...@googlegroups.com
#22170: Add initial migrations for contrib apps
-----------------------------+------------------------------------

Reporter: timo | Owner:
Type: New feature | Status: new
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"eb8600a65673649ea15ed18d17127f741807ac8b"]:
{{{
#!CommitTicketReference repository=""
revision="eb8600a65673649ea15ed18d17127f741807ac8b"
Added database migration for contrib.contenttypes.

Moved contenttypes tests to allow them to run correctly in the presence of
migrations. refs #22170.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22170#comment:15>

Django

unread,
Jun 16, 2014, 3:05:31 PM6/16/14
to django-...@googlegroups.com
#22170: Add initial migrations for contrib apps
-----------------------------+------------------------------------

Reporter: timo | Owner:
Type: New feature | Status: new
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"a0bf14a2accb75987657a9656bccfc8b9df8d375"]:
{{{
#!CommitTicketReference repository=""
revision="a0bf14a2accb75987657a9656bccfc8b9df8d375"
[1.7.x] Added database migration for contrib.contenttypes.

Moved contenttypes tests to allow them to run correctly in the presence of
migrations. refs #22170.

Backport of eb8600a656 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22170#comment:16>

Django

unread,
Jun 16, 2014, 4:23:22 PM6/16/14
to django-...@googlegroups.com
#22170: Add initial migrations for contrib apps
-----------------------------+------------------------------------

Reporter: timo | Owner:
Type: New feature | Status: new
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"b341f33697cdd26cc967c2ca4a0ac679f4167319"]:
{{{
#!CommitTicketReference repository=""
revision="b341f33697cdd26cc967c2ca4a0ac679f4167319"
Added database migration for contrib.auth.

refs #22170.
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22170#comment:17>

Django

unread,
Jun 16, 2014, 4:35:35 PM6/16/14
to django-...@googlegroups.com
#22170: Add initial migrations for contrib apps
-----------------------------+------------------------------------

Reporter: timo | Owner:
Type: New feature | Status: new
Component: Migrations | Version: master
Severity: Normal | Resolution:
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------

Comment (by Tim Graham <timograham@…>):

In [changeset:"d36b54d753a1fb79f32f6b7a91d582bccb7ab311"]:
{{{
#!CommitTicketReference repository=""
revision="d36b54d753a1fb79f32f6b7a91d582bccb7ab311"
[1.7.x] Added database migration for contrib.auth.

refs #22170.

Backport of b341f33697 from master
}}}

--
Ticket URL: <https://code.djangoproject.com/ticket/22170#comment:18>

Django

unread,
Jun 16, 2014, 4:38:02 PM6/16/14
to django-...@googlegroups.com
#22170: Add initial migrations for contrib apps
-----------------------------+------------------------------------
Reporter: timo | Owner:
Type: New feature | Status: closed
Component: Migrations | Version: master
Severity: Normal | Resolution: fixed
Keywords: | Triage Stage: Accepted
Has patch: 1 | Needs documentation: 0
Needs tests: 0 | Patch needs improvement: 1

Easy pickings: 0 | UI/UX: 0
-----------------------------+------------------------------------
Changes (by timo):

* status: new => closed
* resolution: => fixed


Comment:

Initial migrations have now been added for all contrib apps (except
deprecated comments).

--
Ticket URL: <https://code.djangoproject.com/ticket/22170#comment:19>

Reply all
Reply to author
Forward
0 new messages