﻿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
33509	Add SQL comment to describe deliberately no-op migration operations	Adam Johnson	Adam Johnson	"Currently when a field migration is a no-op, the operation description is output in SQL, but nothing else. This can be confusing as to which operations are no-ops. It could be clearer if we output an extra SQL comment when there are deliberately no statements to execute for a given migration operation.

Take for example this output:

{{{
BEGIN;
--
-- Alter field name on Author
--
ALTER ...;
--
-- Alter field title on Book
--
COMMIT;
}}}

The `Author.name` field has an operation applied, whilst `Book.title` needs no changes to the database. This isn't exactly clear from the output - is the `COMMIT` part of the `Book.title` change?

It could be clearer as:

{{{
BEGIN;
--
-- Alter field name on Author
--
ALTER ...;
--
-- Alter field name on Author
--
-- (no-op)
COMMIT;
}}}

(Or perhaps more verbose wording, like ""no SQL to execute"")

I think this can help especially when there are consecutive operations with no-op SQL:

{{{
BEGIN;
--
-- Alter field name on Author
--
-- (no-op)
--
-- Alter field name on Author
--
-- (no-op)
COMMIT;
}}}

(Inspired by #33470, where the OP suggested dropping such migration operation header comments.)"	Cleanup/optimization	closed	Migrations	dev	Normal	fixed			Ready for checkin	1	0	0	0	0	0
