# dbdeploy

> A port of dbdeploy (data migration tool) in Javascript for Node.js.

Latest version **0.7.0** (published 2011-10-10) · 0 weekly downloads

## Install

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

## 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.7.0 |
| Published | 2011-10-10 |
| First published | 2011-10-06 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | * |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 8 |
| Author | Xavier Cambar xavier.cambar@lecoffre.net |
| Maintainers | xavier.cambar |

## Links

- npm: https://www.npmjs.com/package/dbdeploy
- Repository: https://github.com/xcambar/node-dbdeploy
- Issues: https://github.com/xcambar/node-dbdeploy/issues
- npm.io page: https://npm.io/package/dbdeploy

## Recent versions

- 0.7.0 (latest) — 2011-10-10
- 0.5.0 — 2011-10-06

## README

# What is it ?

A data migration tool entirely written in Node.js, inspired by [dbdeploy](http://dbdeploy.com)

It's the little brother of dbdeploy, in pure Javascript.

From the dbdeploy website, the project is described as :

> dbdeploy is a Database Change Management tool. It’s for developers or
> DBAs who want to evolve their database design – or refactor their
> database – in a simple, controlled, flexible and frequent manner.

> Manages the deployment of numbered change scripts to a SQL database, using a simple table in the database to track applied changes.

# Maturity of the project

It's a work in progress. See the 'Planned enhancements' for further information.

# Requirements

* Data migration files (SQL) named as follows: {digit}-{description}.sql (eg, 0001-initial_build.sql)
* A working DB with credentials to create table in it.
* [Commander](https://github.com/visionmedia/commander) for the CLI script. But you can built your very own project-specific script in seconds and in a matter of 3 lines of code

# Features

* Applies only what needs to be applied (doesn't run the whole DB creation scenario every time): Hey, It's a DB _migration_ tool, remember ? ;)
* Fine-grained control of the state of your DB
* Unlike dbdeploy, the UNDO section is not mandatory
* Migrations are run as transactions, so you can not be left in an unstable state

# Installation

* Clone the github repository
* or for easier installation, use npm:

```
npm install dbdeploy
```

# Examples

### From the CLI

_Note_: In order to run the CLI script, your PATH must contain ./node_modules/db-deploy/bin or you'll have to point directly to the script from the root of your project

```
dbdeploy -U username -P password --db database_name -f ./myMigrationsFolder/
```

To get a list of available options, simply run:

```
dbdeploy --help
```


### Programmatically

```javascript
var deploy = require('deploy');
deploy.config({migrationFolder: './myCustomMigrationFolder'});
deploy.run();
```

# Planned enhancements

* Downgrade is not yet fully functional
* Including or excluding data fixtures by deploying a superset of dmigration scripts
* Extend to multiple database adapters (only works with node-postgres)

# License

See LICENSE file at the root of the repository. In 3 letters: MIT

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