# dbdelta

> Database migrations done differently.

Latest version **0.0.10** (published 2019-03-06) · 0 weekly downloads

## Install

```sh
npm install dbdelta
pnpm add dbdelta
yarn add dbdelta
bun add dbdelta
```

Provides the commands `dbdelta`, `dbdelta-es`.

## Health

**Score 10/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; low quality score; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.10 |
| Published | 2019-03-06 |
| First published | 2019-01-29 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 81.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Luke Hodkinson |
| Maintainers | furious.luke |

## Links

- npm: https://www.npmjs.com/package/dbdelta
- npm.io page: https://npm.io/package/dbdelta

## Dependencies (3)

- [pg](https://npm.io/package/pg.md) ^7.6.1
- [js-yaml](https://npm.io/package/js-yaml.md) ^3.12.0
- [commander](https://npm.io/package/commander.md) ^2.19.0

## Recent versions

- 0.0.10 (latest) — 2019-03-06
- 0.0.9 — 2019-03-06
- 0.0.8 — 2019-02-28
- 0.0.7 — 2019-02-25
- 0.0.6 — 2019-02-25
- 0.0.5 — 2019-02-07
- 0.0.4 — 2019-01-30
- 0.0.3 — 2019-01-30
- 0.0.2 — 2019-01-29
- 0.0.1 — 2019-01-29
- 0.0.0 — 2019-01-29

## README

# DBDelta

Database migrations done differently.

## Overview

DBDelta is inpspired heavily by
[migra](https://github.com/djrobstep/migra), for an excellent
description of the concept while these docs are under development
please take a look there.

## Installation

`npm install -g dbdelta`

or

`yarn global add dbdelta`

## Usage

All DBDelta commands take an optional `--database` argument, which
defaults to the enironment variable `DATABASE_URL`.

### Show the current schema

``` bash
dbdelta schema
```

### Synchronise schema

Reads a set of SQL files stored on disk and synchronises the
database. Pass `--show` to see the SQL changes, and `--commit` to keep
the synchronised changes. Also accepts `--base <path>` to specify
where to find the SQL schema files (defaults to the current
directory).

``` bash
dbdelta schema --show --commit --base ./db
```

### Make migrations

Creates a new migration file to carry out the necessary changes to
synchonise the database. Accepts the same argumets as `sync`, with the
addtion of `--migrations <path>` which specifies where to place the
new migraiton.

``` bash
dbdelta make --show --commit --base ./db --migrations ./db/migrations
```

### Migrate database

Migrates the current database using made migrations. TODO

``` bash
dbdelta make --base ./db --migrations ./db/migrations
```

---
_Source: https://npm.io/package/dbdelta · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
