﻿id	summary	reporter	owner	description	type	status	component	version	severity	resolution	keywords	cc	stage	has_patch	needs_docs	needs_tests	needs_better_patch	easy	ui_ux
23988	Fixtures should be loaded after migrations	Yurii Zolot'ko	nobody	"It is currently not possible to add data for apps that have migrations in fixtures/initial_data.json because migrate command loads fixtures after syncdb but before migrations i.e. when required tables do not exist yet.
For example if one adds data for flatpages app in fixtures/initial_data like this:

{{{
{
    ""fields"": {
        ""registration_required"": false,
        ""title"": ""foo"",
        ""url"": ""/url/"",
        ""template_name"": """",
        ""sites"": [1],
        ""content"": ""bar"",
        ""enable_comments"": false
    },
    ""model"": ""flatpages.flatpage"",
    ""pk"": 1
}
}}}
 running ""manage.py migrate"" on new DB will result in:

{{{
    return Database.Cursor.execute(self, query, params)
django.db.utils.OperationalError: Problem installing fixture '/home/user/project/fixtures/initial_data.json': Could not load flatpages.FlatPage(pk=1): no such table: django_flatpage
}}}
This breaks DB creation on ""manage.py test"" as well.
Correct behaviour would be to install initial_data.json AFTER tables for apps with migrations are created as well.

"	Bug	closed	Migrations	1.7	Normal	invalid			Unreviewed	0	0	0	0	0	0
