A migration library for DynamoDB OneTable that supports database schema and content mutations via discrete, reversible migrations. Current stable version is 1.2.1, released on an as-needed basis. Key differentiators include support for both upward/downward migrations and named migrations, ability to seed/remove data, quick dev reset, and persistence of migration history in the table. No module dependencies beyond OneTable, works with AWS SDK v2 and v3, and integrates with SenseDeep Studio and OneTable CLI.
npm install onetable-migrateNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Initializes Migrate with a DynamoDB client and OneTable Table, then loads migrations from a directory and prints status.
Ensure you pass the same params as used to create a Table instance, including client and table name.
Add `await migrate.init()` after constructing Migrate.
Use the `client` parameter directly with a DynamoDBClient (v3) or DocumentClient (v2) instead of passing aws region/credentials.
Use `export default { up, down, ... }` in each migration file.Use .js or .cjs extension for CommonJS, or .mjs for ESM if package.json type is 'module'.
Upgrade to version >=1.1.0 or remove the call to init if you're on an older version.
Set package.json type to 'module' or rename migration file extension to .mjs.
Ensure OneTableParams includes a 'name' property corresponding to the DynamoDB table name.
Pass a string path or an array of string paths to the `dir` option.