Skip to content
VibORM
Esc
navigateopen⌘Jpreview
On this page

Filesystem Storage

Store a Migration V1 estate on the local filesystem

Quick Start

import { createFsStorageWriter, createMigrationClient } from "viborm/migrations";

const migrations = createMigrationClient(client, {
  storage: createFsStorageWriter("./migrations"),
});

createFsStorageWriter is the public filesystem owner. There is no createFsStorageDriver and no path-level get / put / delete.

Configuration

const storage = createFsStorageWriter(baseDir);
Parameter Type Description
baseDir string Estate root. Absolute, or relative to the current working directory.

Directory Structure

migrations/
├── estate.json
├── snapshots/
│   └── <snapshot-hash>.json
├── sql/
│   └── <sql-hash>.sql
└── states/
    └── <state-id>.json

Publication is write-temp, fsync, rehash, then a no-replace hard link. A filename that looks like a digest is not proof until the parser recomputes the hash.

Version Control

Estate artifacts are designed to be committed to git:

git add migrations/
git commit -m "Add user table state"

For the generate/apply/status workflow, see Migrate.

Next Steps

Was this page helpful?