Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mysql-upgrade

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mysql-upgrade

A simple MySQL database upgrade module based on plain SQL files

  • 0.1.2
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

MySQL Upgrade

npm

A simple MySQL database upgrade module based on plain SQL files. For developers who don't use an ORM like Sequelize, but still want to have a database.sync(); functionality.

npm install --save mysql-upgrade

Requirements

This module only works with Node 7.6 or later (because of native support for async/await).

How to use

const upgrade = require('mysql-upgrade')

const upgradeConfig = {

	// MySQL settings (passed directly to the MySQL connector) - at least user, password and database are required
	mysql: {
		host: 'localhost',
		user: 'root',
		password: '',
		database: ''
	},

	// Enable or disable logging output of the module
	// Optional, default: false
	verbose: true,

	// Name of the table that will store the database version
	// Optional, default: '_upgrade_version'
	// Set this if you already have a table '_upgrade_version' to avoid clashing
	table: 'my_upgrade_version',

	// Path where the SQL files are located
	// Optional, default: './database'
	path: './my-sql-files'
};

upgrade(upgradeConfig).then(function(upgraded) {
	console.log(upgraded);
	// { oldVersion: 0, newVersion: 1 }
})

Issues

If you encounter any bugs or problems with this module, please sumit an issue. Pull requests with bugfixes are of course welcome.

Keywords

FAQs

Package last updated on 21 Apr 2017

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