1.0.6 • Published 3 years ago

postgres-migration v1.0.6

Weekly downloads
18
License
ISC
Repository
-
Last release
3 years ago

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:

DB_HOST=localhost
DATABASE_URL=postgresql://localhost:${PORT}/${DATABASE_NAME}
Install package as dev dependency

npm install --save-dev postgres-migration

Usage

structure

.
+-- node_modules
+-- src
|   +-- *.js
+-- sql
|   +-- 001-create-user-table.sql
|   +-- 002-alter-user-table.sql
+-- index.html
+-- package.json
In terminal
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.

{
  "script": {
      "migrate": "postgres-migration"
  }
}
run following command to excute

npm run migrate

Author

👤 Thabang Gideon Magaola

Show your support

Give a ⭐️ if this project helped you!

Contributors

👤 Andre Vermeulen

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.0

3 years ago