https://docs.djangoproject.com/en/6.0/ref/migration-operations/#runpython
On databases that do support DDL transactions (SQLite and PostgreSQL), RunPython operations do not have any transactions automatically added besides the transactions created for each migration. Thus, on PostgreSQL, for example, you should avoid combining schema changes and RunPython operations in the same migration or you may hit errors like OperationalError: cannot ALTER TABLE “mytable” because it has pending trigger events.
The DDL is used for creating and modifying the structure of the objects/entities in the database using some commands and statements. These objects can include aliases, tables, sequences, tables, etc. These statements include CREATE, ALTER, DROP, and TRUNCATE.
https://www.commandprompt.com/education/postgresql-data-definition-language-ddl/#:~:text=The%20DDL%20is%20used%20for,ALTER%2C%20DROP%2C%20and%20TRUNCATE.
DDL transactions means CREATE, ALTER, DROP, TRUNCATE in a transaction.
See also - https://wiki.postgresql.org/wiki/Transactional_DDL_in_PostgreSQL:_A_Competitive_Analysis - https://news.ycombinator.com/item?id=28077797