Migration List
Applied and pending migrations, sorted by version. A migration applied after a later version is flagged — that is the signature of two branches merged without a rebase, and it means this schema matches no single branch.
src/components/ui/migration-list.tsxAbout
From the component's own source, where it was written.
Database migrations, applied and pending.
Order is the version string, never the array order. Migrations are named by timestamp precisely so they sort deterministically, and a list that trusts the order it was handed will show a rebase artefact as the real sequence.
A migration applied *out of order* — one whose version predates an already-applied migration — is flagged. That is the signature of two branches merged without rebasing, and it means the schema on this database is not the schema any single branch describes.
Irreversible migrations are marked. Knowing there is no down-path before you run something is the difference between a rollback and a restore from backup.
Install
npx astralyx-ui add migration-list
Usage
import { MigrationList } from '@/components/ui/migration-list'
<MigrationList migrations={migrations} />Composer
Change the props and the source below follows.
20260714093000create usersApplied84ms
20260801121500add accountsApplied122ms
20260810140000add sessions indexout of orderApplied610ms
Applied after a later version — the usual sign of two branches merged without a rebase.
20260815090000backfill account_idirreversibleApplied41200ms
20260828101500drop legacy_sessionsFailed
ERROR: cannot drop table legacy_sessions because other objects depend on it
20260901080000add role defaultPending
20260902093000add deleted_atPending
<MigrationList migrations={migrations} />API
Generated from the source, so it cannot fall behind the code. One table per exported component, then hooks, functions and types.
MigrationList
Database migrations, applied and pending.
Extends ComponentProps<'div'>.
| Prop | Type | Default | Description |
|---|---|---|---|
| migrations | Migration[] | required | { version, name, state, appliedAt?, duration?, irreversible?, error? }. |
| now | Date | — | — |
| locale | string | 'en-GB' | — |
| emptyLabel | ReactNode | 'No migrations' | — |
| irreversibleLabel | ReactNode | 'irreversible' | — |
| outOfOrderLabel | ReactNode | 'out of order' | — |
| outOfOrderNote | ReactNode | 'Applied after a later version — the usual sign of two branches merged without a rebase.' | — |
| pendingSummary | (count: number) => ReactNode | DEFAULT_PENDING_SUMMARY | — |
| order | detected | — | Applied after a higher version — a merge without a rebase. |
Types
Migration
| Field | Type | Description |
|---|---|---|
| version | string | Sortable identifier — usually a timestamp prefix. |
| name | ReactNode | — |
| state | MigrationState | — |
| appliedAt? | Date | — |
| duration? | number | Execution time in milliseconds. |
| irreversible? | boolean | Knowing there is no down-path before you run something is the difference between a rollback and a restore from backup. |
| error? | ReactNode | — |
| Type | Definition | Description |
|---|---|---|
MigrationState | 'applied' | 'pending' | 'failed' | 'rolled-back' | — |
Behaviour
| Topic | Detail | Description |
|---|---|---|
| ordering | by version | Never by array order. Migrations are timestamp-named precisely so they sort deterministically, and trusting the supplied order shows a rebase artefact as the real sequence. |