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

do-migrate

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

do-migrate - npm Package Compare versions

Comparing version

to
2.0.1

16

lib/process.js

@@ -9,2 +9,5 @@ export var Action;

})(Action || (Action = {}));
function sleep(time = 1) {
return new Promise(resolve => setTimeout(resolve, time));
}
export class Process {

@@ -56,2 +59,3 @@ constructor(db, state) {

for (const item of actions) {
await sleep(100); // Skip some time for exec date gap
try {

@@ -90,5 +94,5 @@ switch (item.action) {

await db.q(migration.sql.do);
await db.q(`
INSERT INTO ${this.state.tableName} (name, do_sql, do_hash, undo_sql, undo_hash)
VALUES ($1, $2, $3, $4, $5)
await db.q(/*sql*/ `
INSERT INTO ${this.state.tableName} (name, do_sql, do_hash, undo_sql, undo_hash, exec_date)
VALUES ($1, $2, $3, $4, $5, $6)
`, [

@@ -98,2 +102,3 @@ name,

migration.undo.sql, migration.undo.hash,
new Date(),
]);

@@ -108,3 +113,3 @@ }

await db.q(migration.sql.do);
await db.q(`
await db.q(/*sql*/ `
UPDATE ${this.state.tableName}

@@ -116,3 +121,3 @@ SET

undo_hash = $5,
exec_date = now()
exec_date = $6
WHERE name = $1

@@ -123,2 +128,3 @@ `, [

migration.undo.sql, migration.undo.hash,
new Date(),
]);

@@ -125,0 +131,0 @@ }

@@ -84,3 +84,3 @@ import path from 'node:path';

`);
const result = await this.db.r(`SELECT * FROM ${this.tableName} ORDER BY exec_date`);
const result = await this.db.r(/*sql*/ `SELECT * FROM ${this.tableName} ORDER BY exec_date`);
this.table = result.map(item => {

@@ -87,0 +87,0 @@ return new Migration(item.name, item.do_sql, item.undo_sql, item.do_hash, item.undo_hash);

{
"name": "do-migrate",
"version": "2.0.0",
"version": "2.0.1",
"description": "PostgreSQL migrator",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet