{"id":35277977,"url":"https://github.com/markwylde/node-mini-migrations","last_synced_at":"2026-05-01T08:32:35.014Z","repository":{"id":65424689,"uuid":"220210105","full_name":"markwylde/node-mini-migrations","owner":"markwylde","description":"A really simple node migrations library that is completely independant of any database or file system.","archived":false,"fork":false,"pushed_at":"2022-11-13T14:17:52.000Z","size":109,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2026-01-03T02:42:35.665Z","etag":null,"topics":["database","migrations","sqlite"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/markwylde.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-11-07T10:26:33.000Z","updated_at":"2022-12-01T09:44:40.000Z","dependencies_parsed_at":"2023-01-23T02:05:14.146Z","dependency_job_id":null,"html_url":"https://github.com/markwylde/node-mini-migrations","commit_stats":{"total_commits":37,"total_committers":3,"mean_commits":"12.333333333333334","dds":"0.43243243243243246","last_synced_commit":"75c246e8a1b30bf57ed16f3be6bae62f80444492"},"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/markwylde/node-mini-migrations","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markwylde%2Fnode-mini-migrations","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markwylde%2Fnode-mini-migrations/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markwylde%2Fnode-mini-migrations/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markwylde%2Fnode-mini-migrations/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/markwylde","download_url":"https://codeload.github.com/markwylde/node-mini-migrations/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/markwylde%2Fnode-mini-migrations/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32490810,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-30T13:12:12.517Z","status":"online","status_checked_at":"2026-05-01T02:00:05.856Z","response_time":64,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["database","migrations","sqlite"],"created_at":"2025-12-30T14:05:09.315Z","updated_at":"2026-05-01T08:32:35.009Z","avatar_url":"https://github.com/markwylde.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Mini Migrations for NodeJS\nA really simple node migrations library that is completely independent of any database or file system.\n\n## Installation\n```bash\nnpm install --save node-mini-migrations\n```\n\n## Example Usage\n### driver\n```javascript\nimport sqlite from 'sqlite-fp/promises.js';\nimport up from 'node-mini-migrations/up.js';\nimport getMigrationsFromDirectory from 'node-mini-migrations/getMigrationsFromDirectory.js';\n\nfunction migrator (db) {\n  return {\n    init: (direction) =\u003e {\n      return sqlite.run(db, 'CREATE TABLE IF NOT EXISTS _migrations (file TEXT PRIMARY KEY);');\n    },\n\n    getMigrationState: (id) =\u003e {\n      return sqlite.getOne(db, 'SELECT file FROM _migrations WHERE file = ?', [id]);\n    },\n\n    setMigrationUp: (id) =\u003e {\n      return sqlite.run(db, 'INSERT INTO _migrations (file) VALUES (?)', [id]);\n    },\n\n    setMigrationDown: (id) =\u003e {\n      return sqlite.run(db, 'DELETE FROM _migrations WHERE file = ?', [id]);\n    },\n\n    handler: (fn) =\u003e fn(db)\n  };\n};\n\nconst db = await sqlite.connect('./test.sqlite');\nawait up(\n  migrator(db),\n  getMigrationsFromDirectory('./test/migrations')\n);\n```\n\n### migration\n```javascript\nexport function up (db) {\n  return db.exec('CREATE TABLE test_table (test TEXT)')\n}\n\nexport function down (db) {\n  return db.exec('DROP TABLE test_table')\n}\n```\n\n## License\nThis project is licensed under the terms of the MIT license.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkwylde%2Fnode-mini-migrations","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmarkwylde%2Fnode-mini-migrations","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmarkwylde%2Fnode-mini-migrations/lists"}