InsertDataMigrationTask
A migration task that inserts a fixed set of rows into a table — the resolved form of a
*.task.json file shaped as { tableName, rows }.
| Property | Type | Required | Description |
|---|---|---|---|
tableName | string | yes | Table to insert into. |
rows | Record<string, any>[] | yes | Rows to insert. |
title | string | no | Human-readable title. Defaults to "Migrate data into <tableName>" when loaded from a *.task.json file. |
filename | string | no | Source file this task was loaded from, if any. |
import type { InsertDataMigrationTask } from '@sqb/migrator';
const task: InsertDataMigrationTask = {
tableName: 'countries',
rows: [
{ code: 'US', name: 'United States' },
{ code: 'DE', name: 'Germany' },
],
};
See Writing Migration Tasks for the
on-disk *.task.json form.