Security News
NVD Backlog Tops 20,000 CVEs Awaiting Analysis as NIST Prepares System Updates
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
node-mini-migrations
Advanced tools
A very small, lightweight and flexible migrations library unconcerned with what database you use
A really simple node migrations library that is completely independant of any database or file system.
npm install --save node-mini-migrations
There are two examples, one using sqlite and another using a pretend custom file system database.
const sqlite = require('sqlite')
module.exports = function () {
let db
return {
init: async () => {
db = await sqlite.open('./test.sqlite')
await db.run('CREATE TABLE IF NOT EXISTS _migrations (file TEXT PRIMARY KEY);')
},
finish: async () => {
await db.close()
},
getMigrationState: async (id) => {
return db.get('SELECT file FROM _migrations WHERE file = ?', [id])
},
setMigrationUp: async (id) => {
return db.run('INSERT INTO _migrations (file) VALUES (?)', [id])
},
setMigrationDown: async (id) => {
return db.run('DELETE FROM _migrations WHERE file = ?', [id])
},
getPassedFunctions: async () => {
return db
}
}
}
module.exports = {
up: db => {
return db.exec('CREATE TABLE test_table (test TEXT)')
},
down: db => {
return db.exec('DROP TABLE test_table')
}
}
You run migrator up
to bring up any migrations or migrator down
to bring them down.
const {up, prepareRun} = require('node-mini-migrations')
up(prepareRun('./migrations'))
This project is licensed under the terms of the MIT license.
FAQs
A very small, lightweight and flexible migrations library unconcerned with what database you use
The npm package node-mini-migrations receives a total of 11 weekly downloads. As such, node-mini-migrations popularity was classified as not popular.
We found that node-mini-migrations demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
NVD’s backlog surpasses 20,000 CVEs as analysis slows and NIST announces new system updates to address ongoing delays.
Security News
Research
A malicious npm package disguised as a WhatsApp client is exploiting authentication flows with a remote kill switch to exfiltrate data and destroy files.
Security News
PyPI now supports digital attestations, enhancing security and trust by allowing package maintainers to verify the authenticity of Python packages.