# caravan-db

> Straightforward database migrations

Latest version **0.3.9** (published 2017-09-08) · MIT license · 0 weekly downloads

## Install

```sh
npm install caravan-db
pnpm add caravan-db
yarn add caravan-db
bun add caravan-db
```

Provides the command `caravan`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.9 |
| Published | 2017-09-08 |
| First published | 2017-09-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 12 |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| Author | Andrew Kanieski |
| Maintainers | akanieski |
| Keywords | database, db, migrations, migration, migrate |

## Links

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

## Dependencies (12)

- [mssql](https://npm.io/package/mssql.md) ^4.0.4
- [sinon](https://npm.io/package/sinon.md) ^3.2.1
- [jasmine](https://npm.io/package/jasmine.md) ^2.8.0
- [ts-node](https://npm.io/package/ts-node.md) ^3.3.0
- [fs-extra](https://npm.io/package/fs-extra.md) ^4.0.1
- [typescript](https://npm.io/package/typescript.md) ^2.4.2
- [@types/mssql](https://npm.io/package/@types/mssql.md) ^4.0.6
- [@types/sinon](https://npm.io/package/@types/sinon.md) ^2.3.3
- [@types/jasmine](https://npm.io/package/@types/jasmine.md) ^2.5.54
- [@types/fs-extra](https://npm.io/package/@types/fs-extra.md) ^4.0.2
- [command-line-args](https://npm.io/package/command-line-args.md) ^4.0.7
- [command-line-usage](https://npm.io/package/command-line-usage.md) ^4.0.1

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [@temporal-architect/claude-plugin](https://npm.io/package/@temporal-architect/claude-plugin.md) — 335 weekly downloads

## Recent versions

- 0.3.9 (latest) — 2017-09-08
- 0.3.8 — 2017-09-08
- 0.3.7 — 2017-09-08
- 0.3.6 — 2017-09-08
- 0.3.5 — 2017-09-07
- 0.3.4 — 2017-09-06
- 0.3.3 — 2017-09-06
- 0.3.2 — 2017-09-06
- 0.3.1 — 2017-09-06

## README

# Caravan DB ![Build & Test Status](https://caravan-db.visualstudio.com/_apis/public/build/definitions/3555b68c-5ff2-4e87-b108-f4356aba4e4a/1/badge)

Caravan helps you automate and apply database migrations in CI/CD environments. Currently supports MSSQL.

## Installation
```npm install -g caravan-db```

## Options
```
 ,adPPYba, ,adPPYYba, 8b,dPPYba, ,adPPYYba, 8b       d8 ,adPPYYba, 8b,dPPYba,
a8"     "" ""     'Y8 88P'   "Y8 ""     'Y8 '8b     d8' ""     'Y8 88P'   '"8a
8b         ,adPPPPP88 88         ,adPPPPP88  '8b   d8'  ,adPPPPP88 88       88
"8a,   ,aa 88,    ,88 88         88,    ,88   '8b,d8'   88,    ,88 88       88
 '"Ybbd8"' '"8bbdP"Y8 88         '"8bbdP"Y8     "8"     '"8bbdP"Y8 88       88


Options

  -c, --connection string   Database connection string in URI format
  -s, --schema string       [Optional] Database schema for migrations
  -t, --table string        [Optional] Table name for migrations
  -d, --debug               [Optional] Debug Mode
  -v, --version             [Optional] Version Information
  -f, --migrationsFolder    [Optional] Migrations folder path
  -h, --help                Help

```

## Getting Started
Create a `migrations` folder and add SQL files that represent each migration. Then you can simply run caravan with the given connection info and it will apply the given migrations, skipping any that have already been applied. Migrations will be applied in alphanumeric order based on the file name.

```
$ caravan -c mssql://localhost/testdb



 ,adPPYba, ,adPPYYba, 8b,dPPYba, ,adPPYYba, 8b       d8 ,adPPYYba, 8b,dPPYba,
a8"     "" ""     'Y8 88P'   "Y8 ""     'Y8 '8b     d8' ""     'Y8 88P'   '"8a
8b         ,adPPPPP88 88         ,adPPPPP88  '8b   d8'  ,adPPPPP88 88       88
"8a,   ,aa 88,    ,88 88         88,    ,88   '8b,d8'   88,    ,88 88       88
 '"Ybbd8"' '"8bbdP"Y8 88         '"8bbdP"Y8     "8"     '"8bbdP"Y8 88       88

[INFO] [11:41:31]   MSSQL migrator initialized

[INFO] [11:41:31]   Checking for migration schema ..

[INFO] [11:41:31]   Migration schema exists!

[INFO] [11:41:31]   Running migrations..

[INFO] [11:41:31]       > 001-do_stuff.sql - Already Applied

[INFO] [11:41:31]       > 002-do_more_stuff.sql - Applied!

[INFO] [11:41:31]   Migrations Complete
```

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