Socket
Socket
Sign inDemoInstall

larvitdbmigration

Package Overview
Dependencies
Maintainers
1
Versions
170
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.2.1 to 0.2.2

29

dbMigrations.js

@@ -77,6 +77,6 @@ 'use strict';

tasks.push(function(cb) {
var sql = 'SHOW TABLES like \'' + options.tableName + '\';';
var sql = 'CREATE TABLE IF NOT EXISTS `' + options.tableName + '` (`version` int(10) unsigned NOT NULL DEFAULT \'0\', `running` tinyint(3) unsigned NOT NULL DEFAULT \'0\') ENGINE=InnoDB DEFAULT CHARSET=ascii COLLATE=ascii_bin COMMENT \'Used for automatic database versioning. Do not modify!\';';
log.debug('larvitdbmigration: Running SQL: "' + sql + '"');
db.query(sql, function(err, rows) {
var customErr;
db.query(sql, function(err) {
var sql = 'INSERT INTO `' + options.tableName + '` (version, running) VALUES(0, 0);';

@@ -88,23 +88,4 @@ if (err) {

if (rows.length === 1) {
cb();
} else if (rows.length === 0) {
sql = 'CREATE TABLE `' + options.tableName + '` (`version` int(10) unsigned NOT NULL DEFAULT \'0\', `running` tinyint(3) unsigned NOT NULL DEFAULT \'0\') ENGINE=InnoDB DEFAULT CHARSET=ascii COLLATE=ascii_bin;';
log.debug('larvitdbmigration: Running SQL: "' + sql + '"');
db.query(sql, function(err) {
var sql = 'INSERT INTO `' + options.tableName + '` (version, running) VALUES(0, 0);';
if (err) {
cb(err);
return;
}
log.debug('larvitdbmigration: Running SQL: "' + sql + '"');
db.query(sql, cb);
});
} else {
customErr = new Error('larvitdbmigration: SHOW TABLES like \'' + options.tableName + '\'; returned either 0 or 1 rows, but: "' + rows.length + '"');
log.error(customErr.message);
cb(customErr);
}
log.debug('larvitdbmigration: Running SQL: "' + sql + '"');
db.query(sql, cb);
});

@@ -111,0 +92,0 @@ });

2

package.json

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

},
"version": "0.2.1",
"version": "0.2.2",
"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