# postgres-migration

Latest version **1.0.6** (published 2021-02-03) · ISC license · 0 weekly downloads

## Install

```sh
npm install postgres-migration
pnpm add postgres-migration
yarn add postgres-migration
bun add postgres-migration
```

Provides the command `postgres-migration`.

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2021-02-03 |
| First published | 2021-01-26 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 5.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Thabang Gideon Magaola &  André Vermeulen |
| Maintainers | gideon877 |

## Links

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

## Dependencies (3)

- [pg](https://npm.io/package/pg.md) ^8.5.1
- [dotenv](https://npm.io/package/dotenv.md) ^8.2.0
- [find-config](https://npm.io/package/find-config.md) ^1.0.0

## Recent versions

- 1.0.6 (latest) — 2021-02-03
- 1.0.5 — 2021-02-02
- 1.0.4 — 2021-02-02
- 1.0.3 — 2021-01-26
- 1.0.2 — 2021-01-26
- 1.0.0 — 2021-01-26

## README

# cli-migration


##### Creating environment variables file

> Create a .env file in the root directory of your project. Add environment-specific variables on new lines in the form of NAME=VALUE. For example:

```bash
DB_HOST=localhost
DATABASE_URL=postgresql://localhost:${PORT}/${DATABASE_NAME}
```

##### Install package as dev dependency

> npm install --save-dev postgres-migration

##### Usage 

> ### `structure`

```bash
.
+-- node_modules
+-- src
|   +-- *.js
+-- sql
|   +-- 001-create-user-table.sql
|   +-- 002-alter-user-table.sql
+-- index.html
+-- package.json
```

###### In terminal

```bash
postgres-migration
```

You can do a few things like:

* checking the current migration index `postgres-migration index`
* set the current migration index using `postgres-migration seed 7`
* run some sql using using `postgres-migration execute "select * from your_table" `

or add this in your `package.json` file.

```json
{
  "script": {
      "migrate": "postgres-migration"
  }
}
```

###### run following command to excute

> npm run migrate


## Author

👤 **Thabang Gideon Magaola**

* Website: https://gideon877.github.io/portfolio/
* Twitter: [@gideon877](https://twitter.com/gideon877)
* Github: [@gideon877](https://github.com/gideon877)
* LinkedIn: [@gideon877](https://linkedin.com/in/gideon877)

## Show your support

Give a ⭐️ if this project helped you!

## Contributors

👤 **Andre Vermeulen**

* Github: [@avermeulen](https://github.com/avermeulen)

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