Adding a new column is not just an act of storage; it’s an architectural decision. It alters queries, indexes, and the contracts your application depends on. Whether you’re working in PostgreSQL, MySQL, or a distributed database, the mechanics are the same: define it, propagate it, and make it safe under load.
Start with the ALTER TABLE command. Use explicit data types. Avoid nulls unless there is a clear default. Adding a new column with the wrong constraints forces downstream code changes and increases risk. In production, run migrations online—tools like pt-online-schema-change or native PostgreSQL background operations can prevent locks and downtime.
Once the column exists, update the ORM models, serializers, and API payloads. Keep compatibility in mind. Deploy changes in stages: write logic that supports both the old and new schema until all systems can consume the updated format. This is especially important in environments with multiple services reading from the same table.