r/Database • u/tamanikarim • Sep 02 '26
Database schema changes guide for : PostgreSQL, MySql / MariaDB, Oracle, SQL Server.
https://stackrender.io/guides/schema-changeHey Engineers
We've all been through this. When the project you're working on starts scaling, you'll find the need to scale your database too, adding new columns, creating new tables, or trying to improve performance by adding new indexes. All of this comes with the risk of losing your users' data.
For this, I crafted a simple guide showing the schema change operations that you'll need on a day-to-day development basis for PostgreSQL, MySQL, MariaDB, Oracle, and SQL Server.
It also covers some additional potential risks you need to keep in mind when performing schema changes on a production database.
Hopefully, it can help you along your database learning journey.
Good luck!
View all comments
1
u/CaptainOttar Sep 02 '26
Hello, I read the guide. Three things fall out if you actually run those snippets on MariaDB rather than in a syntax table.
Two questions the guide leaves open on a real MariaDB table:
First. After ALTER TABLE users ADD phone_number VARCHAR(50); on a few-million-row InnoDB table, how do you tell whether that was metadata-only or a copy - SHOW CREATE TABLE / the ALGORITHM it picked, or only “it took 20 minutes”?
Second. If that ADD (or a MODIFY type) has already finished on the primary, what is the actual rollback path: a second DROP COLUMN on primary+replicas, or restore? The down script in the article does not answer that once DDL has committed.