There are several ways to track the DDL of a database, among which the main consideration is how to filter the useful records. Of course, using triggers can add filtering conditions in the SQL, but it will affect the performance of the production database.
Refer to
Extended Events:https://www.sqlskills.com/blogs/jonathan/an-xevent-a-day-31-of-31-event-session-ddl-events/
CREATE DATABASE AUDIT SPECIFICATION
CDC:https://www.mssqltips.com/sqlservertip/4096/understanding-how-dml-and-ddl-changes-impact-change-data-capture-in-sql-server/
Regards
Mikey Qiao
If you're satisfied with the answer, don't forget to "Accept it," as this will help others who have similar questions to yours.