* feat(types): move Emigrate types to separate package Also refactor the types to use discriminating unions for easier error handling and such. Errors passed to storage plugins should now be serialized and storage plugins are expected to return already serialized errors on failed history entries. * fix(mysql): handle the new type changes * fix(storage-fs): handle the new type changes * feat(cli): better error handling and types Adapt to the new types from the @emigrate/types package, like discriminating union types and serializing and deserializing errors |
||
|---|---|---|
| .. | ||
| src | ||
| CHANGELOG.md | ||
| package.json | ||
| README.md | ||
| tsconfig.json | ||
@emigrate/storage-fs
A file system storage plugin for Emigrate, suitable for simple migration setups. To support containerized environments, it is recommended to use a database storage plugin instead.
Installation
Install the storage plugin in your project, alongside the Emigrate CLI:
npm install --save-dev @emigrate/cli @emigrate/storage-fs
Usage
Configure the storage in your emigrate.config.js file:
import storageFs from '@emigrate/storage-fs';
export default {
directory: 'migrations',
storage: storageFs({ filename: '.migrated.json' }),
};
Or use the CLI option --storage (or -s):
emigrate up --storage fs # the @emigrate/storage- prefix is optional