Database migrations – the process of gradually upgrading database structure by writing SQL scripts or code, are essential whenever your application evolves. For example, adding a new feature often requires altering tables or columns in your databases or inserting new data. API Maker streamlines this by letting you write migration scripts in TypeScript (Node.js) with native SQL. These scripts can be run on demand to bring any database to the required schema state.
When deploying code across development, staging, and production, keeping every database in sync is critical. Each update or new feature might need new tables or columns, and failing to apply those changes everywhere can break your app.
Database migrations solve this by treating schema changes like version-controlled code. As API Maker’s documentation notes, migration scripts “bring databases to a specific stage” only if they aren’t already there.
In other words, the system checks the current state and applies only the needed updates. This ensures that each environment – from a single developer’s sandbox to the live database – ends up with the correct structure.
API Maker’s migration tool is built for developers. Some of the key features include:
These features mean teams and technical stakeholders get a reliable, repeatable process. Business teams benefit because migrations become part of the deployment workflow, database updates happen automatically when code is deployed (for example, on a Git pull) rather than through manual steps.
Under the hood, an API Maker migration is essentially a Node.js function. The function uses API Maker’s system APIs to inspect and modify the database. For example, the code below (based on the API Maker docs) shows a simple migration that adds a description
column if it’s missing:
import * as T from 'types';
import * as db from 'db-interfaces';
import * as _ from 'lodash';
async function main(g: T.IAMGlobal) {
let order_transactions_meta = await g.sys.system.getTableMeta({
instance: 'mysql8',
database: 'inventory',
table: 'order_transactions'
});
let hasDescriptionColumn = !!_.find(
order_transactions_meta,
{ name: 'description' }
);
let isAlterTableScriptExecuted = false;
if (!hasDescriptionColumn) {
await g.sys.system.executeQuery({
instance: 'mysql8',
query: "ALTER TABLE `inventory`.`order_transactions`" +
" ADD COLUMN `description` varchar(255) NULL AFTER `qty`"
});
isAlterTableScriptExecuted = true;
}
return { hasDescriptionColumn, order_transactions_meta };
};
module.exports = main;
g.sys.system.getTableMeta
provided by API Maker then we check if the order_transactions
table already has a description
column.description
column.To use migrations in API Maker, you simply create a new Migration Script in the platform’s admin UI. Each script will be committed in git repository and can be executed on demand. You’ll find a list of saved scripts in the UI, and one-click “run script” options. The system will show you the results (success or errors) immediately.
For businesses, this means database changes become auditable and repeatable. Instead of ad-hoc updates, every schema change is tracked as code. Technical team members can review that code or have confidence it runs the same way everywhere. Because API Maker lets you “maintain state of database” across environments, you get fewer deployment headaches and downtime.
API Maker’s database migrations feature automates schema management: it uses familiar JavaScript/SQL scripts, supports all major databases, and provides a visual interface for testing. It keeps your production and development databases in sync effortlessly. Whether you’re a developer or a project manager, this means faster releases and more reliable updates with less manual work.
Managing database schema changes is a critical part of modern application development. API Maker’s database migration feature compares to others:
Feature / Tool | API Maker | Supabase | AppWrite |
---|---|---|---|
🔧 Code-Based Migrations | ✅ TypeScript + raw SQL inside a Node.js script with API Maker's system APIs | ⚠️ Yes with supabase migration CLI | ⚠️ Yes but not with native SQL. Inbuilt framework & CLI tool which need to learn. |
📦 Built-in UI for Execution | ✅ Full UI for writing, testing, running migration scripts | ✅ Yes with supabase dashboard | ❌ No. Cli based migrations |
🧠 Intelligent Schema Detection | ✅ Inbuilt system APIs for schema detection. | ❌ Limited detection | ❌ Not supported |
👀 Generate SQL Automatically | ⚠️ Not required due to dynamic nature of API Maker's schema less APIs | ✅ Yes, supported | ✅ Yes, supported |
📚 Multiple Database Types Support | ✅ One migration script can migrate multiple database types | ❌ Not supported. PostgreSQL only | ❌ Not supported |
📄 Logs & History | ✅ Tracks every run, success/failure, with logs | ✅ Activity feed shows in dashboard | ✅ UI shows migration process. |
🚀 Without CLI | ✅ CLI not required | ❌ CLI required | ❌ CLI required |
👥 Trigger from UI | ✅ Even PMs can trigger or view migrations | ❌ No, CLI required | ✅ Yes with built-in UI |
🔄 Instant Apply (No Redeploy) | ✅ Yes, apply instantly across database types & installation | ✅ Yes, apply instantly | ✅ Yes, apply instantly |
📈 Enterprise Scalability | ✅ Designed for multi instance, high-scale apps | ⚠️ Limited, due to PostgreSQL only | ⚠️ Limited, due to their own database |
Whether you're a developer, project manager, or running a team, API Maker makes migrations safe, scalable, and simple – without losing flexibility.
Most tools treat migrations as a side project. API Maker treats them as a first-class citizen, integrated into your development workflow, API logic, and UI and we can use common functions of APIs and Migrations together. It's ideal for startups looking to scale or enterprises looking for stability.
Ready to migrate without the migraine? Try API Maker.
Zero Downtime, Instant Updates
Smart & Safe Execution
Visual Editor for Migrations
ctrl + i
and insert them.Human Readable History Logs
Rollbacks & Version Control
Supports Native SQL + TypeScript
Multi-Environment Friendly
Works with Any Database
Enterprise-Ready
No matter what database you're using, API Maker keeps your schema or data changes smooth, secure, and consistent across environments.
Yes! You can create new tables, modify existing ones, add or drop columns, change data types, and even manage indexes. You can validate those things are already done or not using native SQL scripts and them actually perform that.
Absolutely. API Maker supports 8 major databases: PostgreSQL, MySQL, MariaDB, Microsoft SQL Server, Oracle DB, Percona XtraDB, TiDB, MongoDB . You can write one migration script and it can perform migrations of multiple database types.
Yes. API Maker is framework for developers so it is expected prerequisite that developer knows programming & basic database concepts and how SQL works.
Yes & No. It totally depends on how you have written migration script and what is your business requirement.
Definitely. You can preview, simulate, and test your migrations in a dev or staging environments, then promote the exact same script to production.
Each migration has its own name. You can view the entire history of applied migrations.
You need to write migration script manually so you have total control over it.
No redeployment is needed. Once you apply a migration from the Admin UI, the changes go live instantly on the connected database.
Only users with the appropriate permissions can create, edit, or apply migrations.