﻿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
23347	Add --dry-run to migrate	no	nobody	"In a similar vein to https://code.djangoproject.com/ticket/23263, I would like to propose that a ""--dry-run"" or ""--check"" be added to the `migrate` command. Basically, I want to be able to run through the migrations without it making database changes, so that I can see if I've broken something, especially if I'm writing a migration with a `RunPython`. 

Another way I can see this working, is if sqlmigrate could also output all the sql that was issued, including those issued by `RunPython`, so that if I had the following migration [#migration '[0]'] it would output something similar to [#output '[1]']


[=#migration [0]] Migration:
{{{#!python
# -*- coding: utf-8 -*-
from __future__ import unicode_literals

from django.db import models, migrations

def update_contenttypes(apps, schema_editor):
	ContentType = apps.get_models('contenttypes', 'ContentType')
	ContentType.objects.get(pk = 1)

class Migration(migrations.Migration):
	dependencies = [
		('everdeal', '0001_initial'),
	]
	
	operations = [
		migrations.RunPython(update_contenttypes)
	]

}}}


[=#output [1]] Output:

{{{#!bash
BEGIN;
--
-- MIGRATION NOW PERFORMS OPERATION THAT CANNOT BE WRITTEN AS SQL:
-- Raw Python operation
SELECT * FROM contenttypes_contenttype WHERE id=1;
--

ROLLBACK;


}}}"	New feature	closed	Migrations	1.7-rc-3	Normal	needsinfo			Unreviewed	0	0	0	0	0	0
