Migrations let you change your database schema safely, in versioned steps, instead of editing tables by hand.
Framework migrations
Most frameworks ship with a migration system — Laravel’s php artisan migrate, Django’s python manage.py migrate, Rails’ rake db:migrate, and so on. MonkeysCloud runs these as part of your build pipeline when configured.
Running migrations on deploy
Add a migration step to your pipeline config so the schema is updated before the app serves traffic:
build:
custom_steps:
- name: "Run migrations"
command: "php artisan migrate --force"
Keep migrations forward-only
- Write new migrations instead of editing old ones — teammates and other environments need a consistent history.
- Back up the database before large schema changes.
- Test migrations against staging first.
Rollback considerations
Some frameworks support rolling back a migration. Use it carefully, and remember that data removed by a destructive migration may be gone for good.