#24919 closed New feature (fixed)
Add an option not to run migrations when running tests
Reported by: | Kai Richard König | Owned by: | Andrew Godwin |
---|---|---|---|
Component: | Migrations | Version: | dev |
Severity: | Normal | Keywords: | 1.9 |
Cc: | Andrew Godwin, cmawebsite@… | Triage Stage: | Ready for checkin |
Has patch: | yes | Needs documentation: | no |
Needs tests: | no | Patch needs improvement: | no |
Easy pickings: | no | UI/UX: | no |
Description
With large apps it takes too long to run all migrations if you just want to run a single test or testcase. Furthermore keepdb is not an option if you already use an in memory sqlite db.
Change History (19)
comment:1 Changed 8 years ago by
Cc: | Andrew Godwin added |
---|
comment:2 Changed 8 years ago by
Summary: | Don't run migrations when running tests → Add an option not to run migrations when running tests |
---|---|
Triage Stage: | Unreviewed → Accepted |
Type: | Uncategorized → New feature |
Version: | 1.8 → master |
comment:3 Changed 8 years ago by
comment:4 Changed 8 years ago by
Owner: | changed from nobody to Andrew Godwin |
---|---|
Status: | new → assigned |
comment:8 Changed 8 years ago by
Cc: | cmawebsite@… added |
---|
comment:9 Changed 8 years ago by
@andrewgodwin what's your thought about https://github.com/django/django/pull/5255
comment:10 Changed 8 years ago by
Has patch: | set |
---|---|
Keywords: | 1.9 added |
comment:11 follow-up: 15 Changed 8 years ago by
Patch needs improvement: | set |
---|
Added some ideas for improvement to the PR.
As I mentioned in IRC, it could also be useful to allow the DATABASES['TEST']['MIGRATE'] = False
option that Andrew's first PR suggested to be a shortcut for setting MIGRATION_MODULES = {'a': None, 'b': None', ...}
for all apps. This could be done later or in a separate commit though. The main concern I have with this idea is whether or not it makes sense in a multi-db situation.
comment:12 Changed 8 years ago by
Patch needs improvement: | unset |
---|---|
Triage Stage: | Accepted → Ready for checkin |
comment:15 Changed 8 years ago by
Replying to timgraham:
Added some ideas for improvement to the PR.
As I mentioned in IRC, it could also be useful to allow the
DATABASES['TEST']['MIGRATE'] = False
option that Andrew's first PR suggested to be a shortcut for settingMIGRATION_MODULES = {'a': None, 'b': None', ...}
for all apps. This could be done later or in a separate commit though. The main concern I have with this idea is whether or not it makes sense in a multi-db situation.
I created #25388 to keep track of this proposal if somebody wants to work on it.
See discussion and PR