{"id":14974169,"url":"https://github.com/lucasferreira/db-migr","last_synced_at":"2026-02-24T21:34:07.157Z","repository":{"id":66341055,"uuid":"150910324","full_name":"lucasferreira/db-migr","owner":"lucasferreira","description":"Javascript db migrations utility for SQLite, MySQL or other SQL Ansi databases","archived":false,"fork":false,"pushed_at":"2018-10-03T14:12:59.000Z","size":26,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-09-27T10:42:55.353Z","etag":null,"topics":["javascript","migrations","sqlite3","tool","upgrade","utility"],"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/lucasferreira.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2018-09-29T23:14:16.000Z","updated_at":"2023-02-16T19:29:16.000Z","dependencies_parsed_at":"2023-03-10T23:51:17.576Z","dependency_job_id":null,"html_url":"https://github.com/lucasferreira/db-migr","commit_stats":{"total_commits":5,"total_committers":1,"mean_commits":5.0,"dds":0.0,"last_synced_commit":"3439cff866a15c9bc80c474e335d2b10fa271769"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/lucasferreira/db-migr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasferreira%2Fdb-migr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasferreira%2Fdb-migr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasferreira%2Fdb-migr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasferreira%2Fdb-migr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucasferreira","download_url":"https://codeload.github.com/lucasferreira/db-migr/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasferreira%2Fdb-migr/sbom","scorecard":{"id":601982,"data":{"date":"2025-08-11","repo":{"name":"github.com/lucasferreira/db-migr","commit":"3439cff866a15c9bc80c474e335d2b10fa271769"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":1.7,"checks":[{"name":"Packaging","score":-1,"reason":"packaging workflow not detected","details":["Warn: no GitHub/GitLab publishing workflow detected."],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}},{"name":"Dangerous-Workflow","score":-1,"reason":"no workflows found","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Maintained","score":0,"reason":"0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Token-Permissions","score":-1,"reason":"No tokens found","details":null,"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"Pinned-Dependencies","score":-1,"reason":"no dependencies found","details":null,"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Code-Review","score":0,"reason":"Found 0/5 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"Signed-Releases","score":-1,"reason":"no releases found","details":null,"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: MIT License: LICENSE:0"],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'master'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Vulnerabilities","score":0,"reason":"31 existing vulnerabilities detected","details":["Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw","Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92","Warn: Project is vulnerable to: GHSA-v6h2-p8h4-qcjw","Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx","Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4","Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg","Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275","Warn: Project is vulnerable to: GHSA-w573-4hg7-7wgq","Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3","Warn: Project is vulnerable to: MAL-2023-462","Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37","Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h","Warn: Project is vulnerable to: GHSA-6c8f-qphg-qjgp","Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695","Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw","Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9","Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm","Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv","Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3","Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m","Warn: Project is vulnerable to: GHSA-xvch-5gv4-984h","Warn: Project is vulnerable to: GHSA-fhjf-83wg-r2j9","Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw","Warn: Project is vulnerable to: GHSA-4g88-fppr-53pp","Warn: Project is vulnerable to: GHSA-4jqc-8m5r-9rpr","Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9","Warn: Project is vulnerable to: GHSA-r628-mhmh-qjhw","Warn: Project is vulnerable to: GHSA-9r2w-394v-53qc","Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh","Warn: Project is vulnerable to: GHSA-qq89-hq3f-393p","Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36"],"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}}]},"last_synced_at":"2025-08-21T00:41:26.972Z","repository_id":66341055,"created_at":"2025-08-21T00:41:26.972Z","updated_at":"2025-08-21T00:41:26.972Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":29801033,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-02-24T21:02:39.706Z","status":"ssl_error","status_checked_at":"2026-02-24T21:02:21.834Z","response_time":75,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.6:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"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":["javascript","migrations","sqlite3","tool","upgrade","utility"],"created_at":"2024-09-24T13:50:05.207Z","updated_at":"2026-02-24T21:34:07.140Z","avatar_url":"https://github.com/lucasferreira.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# db-migr\n\n## Installation\n\nSince the library is a JS-based solution, to install the latest version of `db-migr` you only need to run:\n\n```bash\n$ npm install --save db-migr\n```\n\nor\n\n```bash\n$ yarn add db-migr\n```\n\n## How it works\n\nThis tool implements a lightweight migrations API that works with a array of migrations as the follow example:\n\n```javascript\nconst migrations = [\n  {\n    name: \"001-create-table\",\n    migration: `\n-- Up\nCREATE TABLE IF NOT EXISTS \"people\" (\n  id   INTEGER PRIMARY KEY,\n  name TEXT    NOT NULL\n);\n\n-- Down\nDROP TABLE people;`,\n  },\n  {\n    name: \"002-create-index-name\",\n    migrationUp: `CREATE INDEX people_name ON people (name)`,\n    migrationDown: `DROP INDEX people_name`,\n  },\n  {\n    name: \"003-create-field\",\n    migration: [\n      \"ALTER TABLE people ADD address VARCHAR(255)\",\n      \"ALTER TABLE people ADD email VARCHAR(60)\"\n    ],\n  },\n  {\n    name: \"004-create-index-email\",\n    migration: `CREATE INDEX people_email ON people ('email')`,\n  },\n];\n```\n\nThe `name` attribute it's required in each `migration`, so you can use this attribute as execution order and history. Every `name` needs to follow this format `{n}-{description}`. Migrations with names that didn't start with number will be ignored.\n\nEach `migration` in your array could be based in a complex string, or using two attributes `migrationUp` and `migrationDown`. You could use in up operations some array of queries also.\n\nIt's very important to keep a history of migrations in your migrations array, if you remove some migration entry in futures updates/releases if you implements some `migrationDown` query this tool will automatically reverts your `migrationUp`.\n\n### Implement your query runner\n\nTo make this tool more versatile *we didn't implement* a default _query runner_ method, so you can use this tool with your favorite database adapter just implementing some promisable/async _query_ function.\n\n#### Simple generic example:\n\n```javascript\nimport migr from \"db-migr\";\n\nconst myMigrations = [\n  // a incremental list of migrations for your db...\n];\n\nconst dbConn = ...implements your database connection\n\n// run your migrations when you are sure that your db connection are already opened\nmigr({\n  // implemention your query runner [required]\n  // this method needs to return some promisable function\n  query: async (query, params = []) =\u003e {\n    return await dbConn.executeSql(query, params);\n  },\n  // pass your migrations\n  migrations: myMigrations\n}).then(() =\u003e {\n  // if you got here, everything ran ok\n}).catch(err =\u003e {\n  // if you got here, something wrong happened\n  // and you could look to `err` object\n});\n```\n\n## License\n\n[MIT](./LICENSE)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucasferreira%2Fdb-migr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucasferreira%2Fdb-migr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucasferreira%2Fdb-migr/lists"}