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

larvitdbmigration

Package Overview
Dependencies
Maintainers
1
Versions
179
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

larvitdbmigration - npm Package Compare versions

Comparing version 0.3.0 to 0.3.1

25

dbMigrations.js

@@ -134,2 +134,27 @@ 'use strict';

// Update old version of table (for seamless updating of old versions of this module)
tasks.push(function(cb) {
db.query('DESCRIBE `' + options.tableName + '`', function(err, rows) {
if (err) {
cb(err);
return;
}
if (rows.length === 2 && rows[0].Field === 'version' && rows[1].Field === 'running') {
// Old version detected! Update!
db.query('ALTER TABLE `' + options.tableName + '` ADD `id` tinyint(1) unsigned NOT NULL DEFAULT \'1\' FIRST;', function(err) {
if (err) {
cb(err);
return;
}
db.query('ALTER TABLE `' + options.tableName + '` ADD PRIMARY KEY `id` (`id`);', cb);
});
} else {
// Nothing to do, continue
cb();
}
});
});
// Insert first record if it does not exist

@@ -136,0 +161,0 @@ tasks.push(function(cb) {

2

package.json

@@ -33,3 +33,3 @@ {

},
"version": "0.3.0",
"version": "0.3.1",
"readmeFilename": "README.md",

@@ -36,0 +36,0 @@ "scripts": {},

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