﻿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
24550	Always add description of migration operation to sqlmigrate output	Markus Holtermann	Markus Holtermann	"Especially when debugging the SQL code generated from migration files it can be hard to see where the code of one migration operation ends and where the next one starts. Instead of only including an operation's description when the operation [https://github.com/django/django/blob/75430be86f4c90b7fb8a370d2b080a8a7cc925a0/django/db/migrations/migration.py#L95-L99 cannot be reduced to SQL code] I propose to always output the description:

{{{#!sql
BEGIN;
--
-- Create model Author
--
CREATE TABLE ""testapp_author"" (""id"" serial NOT NULL PRIMARY KEY);
--
-- Create model Publisher
--
CREATE TABLE ""testapp_publisher"" (""id"" serial NOT NULL PRIMARY KEY, ""name"" varchar(100) NOT NULL);
--
-- Add field publishers to author
--
CREATE TABLE ""testapp_author_publishers"" (""id"" serial NOT NULL PRIMARY KEY, ""author_id"" integer NOT NULL, ""publisher_id"" integer NOT NULL);
ALTER TABLE ""testapp_author_publishers"" ADD CONSTRAINT ""testapp_author_publishe_author_id_ab13cccc_fk_testapp_author_id"" FOREIGN KEY (""author_id"") REFERENCES ""testapp_author"" (""id"") DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE ""testapp_author_publishers"" ADD CONSTRAINT ""testapp_author_pu_publisher_id_60b8aa93_fk_testapp_publisher_id"" FOREIGN KEY (""publisher_id"") REFERENCES ""testapp_publisher"" (""id"") DEFERRABLE INITIALLY DEFERRED;
ALTER TABLE ""testapp_author_publishers"" ADD CONSTRAINT ""testapp_author_publishers_author_id_6e6ec2f2_uniq"" UNIQUE (""author_id"", ""publisher_id"");
CREATE INDEX ""testapp_author_publishers_4f331e2f"" ON ""testapp_author_publishers"" (""author_id"");
CREATE INDEX ""testapp_author_publishers_2604cbea"" ON ""testapp_author_publishers"" (""publisher_id"");

COMMIT;
}}}"	New feature	closed	Migrations	dev	Normal	fixed			Ready for checkin	1	0	0	0	0	0
