Preparing your workspace
Migrations control schema changes, while backups and recovery procedures protect the database from operational failures and data loss.
As applications evolve, their database schema also changes. Migration systems record versioned changes such as new tables, columns, constraints, and indexes. Production migrations should be reviewed, tested, and designed with deployment compatibility in mind. Backups provide recovery options after data loss or infrastructure problems, but backups should also be restored and tested regularly. Recovery planning should consider how much data can be lost and how quickly the system needs to return to service.
A platform may add an organizations table through a migration and maintain regular backups so student and course data can be restored after a failure.
CREATE TABLE organizations ( id UUID PRIMARY KEY, name TEXT NOT NULL, created_at TIMESTAMPTZ NOT NULL DEFAULT now() ); CREATE INDEX idx_organizations_name ON organizations(name);
The migration creates a new organizations table and an index for searching organization names.