New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

megrim

Package Overview
Dependencies
Maintainers
1
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

megrim

Migration Tool for Postgres databases in node.js

  • 2.1.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
12
increased by71.43%
Maintainers
1
Weekly downloads
 
Created
Source

megrim

Migration Tool for Postgres databases in node.js

usage

node_modules/.bin contains add-migration and migrate.

add-migration

add-migration <name> will add a migration file to schema/$timestamp-$name.sql. Custom SQl can be written into this file.

migrate

migrate will execute all migrations which are not yet in the database. Therefore migrate will look at the environment variable DATABASE_URL.

Technical Implementaiton

megrim = require 'megrim'
megrim path_to_migrations, psql_connection, (err, result) ->
    console.err err if err?
    console.log result

All sql files in path_to_migrations which are not yet in the database are executed. After successful execution the timestamp of the migration file is added to the schema_info table.

The format of the migrations files should be

YYYYMMDDHHMMSS-description.sql

License MIT

FAQs

Package last updated on 01 Oct 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc