diff --git a/django/core/management/commands/loaddata.py b/django/core/management/commands/loaddata.py
index b6a1e1d..30e2648 100644
a
|
b
|
from django.core.management.base import BaseCommand, CommandError
|
13 | 13 | from django.core.management.color import no_style |
14 | 14 | from django.db import (connections, router, transaction, DEFAULT_DB_ALIAS, |
15 | 15 | IntegrityError, DatabaseError) |
| 16 | from django.db.migrations.loader import MigrationLoader |
16 | 17 | from django.utils import lru_cache |
17 | 18 | from django.utils.encoding import force_text |
18 | 19 | from django.utils.functional import cached_property |
… |
… |
class Command(BaseCommand):
|
235 | 236 | for app_config in apps.get_app_configs(): |
236 | 237 | if self.app_label and app_config.label != self.app_label: |
237 | 238 | continue |
238 | | app_dir = os.path.join(app_config.path, 'fixtures') |
239 | | if os.path.isdir(app_dir): |
240 | | dirs.append(app_dir) |
| 239 | |
| 240 | # Don't install migrated Apps |
| 241 | loader = MigrationLoader(connections[self.using]) |
| 242 | if app_config.label not in loader.migrated_apps: |
| 243 | app_dir = os.path.join(app_config.path, 'fixtures') |
| 244 | if os.path.isdir(app_dir): |
| 245 | dirs.append(app_dir) |
241 | 246 | dirs.extend(list(settings.FIXTURE_DIRS)) |
242 | 247 | dirs.append('') |
243 | 248 | dirs = [upath(os.path.abspath(os.path.realpath(d))) for d in dirs] |