{"id":36632156,"url":"https://github.com/go-bridget/mig","last_synced_at":"2026-01-12T09:39:22.433Z","repository":{"id":57524991,"uuid":"248495896","full_name":"go-bridget/mig","owner":"go-bridget","description":"Database migration utility","archived":false,"fork":false,"pushed_at":"2026-01-01T22:35:02.000Z","size":364,"stargazers_count":18,"open_issues_count":0,"forks_count":1,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-01-03T05:33:29.426Z","etag":null,"topics":["database-schema","lint","sql"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/go-bridget.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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2020-03-19T12:20:27.000Z","updated_at":"2026-01-02T21:41:00.000Z","dependencies_parsed_at":"2025-12-31T19:08:31.678Z","dependency_job_id":null,"html_url":"https://github.com/go-bridget/mig","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/go-bridget/mig","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-bridget%2Fmig","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-bridget%2Fmig/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-bridget%2Fmig/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-bridget%2Fmig/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/go-bridget","download_url":"https://codeload.github.com/go-bridget/mig/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/go-bridget%2Fmig/sbom","scorecard":{"id":431457,"data":{"date":"2025-08-11","repo":{"name":"github.com/go-bridget/mig","commit":"3ef9a75496162b5a43ad10b5e85c9e738f4eea5b"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.4,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 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":"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":"Maintained","score":5,"reason":"7 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 5","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"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":"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":"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":"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":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: containerImage not pinned by hash: docker/Dockerfile:1: pin your Docker image by updating alpine:latest to alpine:latest@sha256:4bcff63911fcb4448bd4fdacec207030997caf25e9bea4045fa6c8c44de311d1","Info:   0 out of   1 containerImage dependencies pinned"],"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":"License","score":10,"reason":"license file detected","details":["Info: project has a license file: LICENSE:0","Info: FSF or OSI recognized license: Apache License 2.0: 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":"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":"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":10,"reason":"0 existing vulnerabilities detected","details":null,"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-19T03:26:54.972Z","repository_id":57524991,"created_at":"2025-08-19T03:26:54.973Z","updated_at":"2025-08-19T03:26:54.973Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28337739,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-12T06:09:07.588Z","status":"ssl_error","status_checked_at":"2026-01-12T06:05:18.301Z","response_time":98,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5: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":["database-schema","lint","sql"],"created_at":"2026-01-12T09:39:21.852Z","updated_at":"2026-01-12T09:39:22.428Z","avatar_url":"https://github.com/go-bridget.png","language":"Go","readme":"# mig\n\nMig is a database SQL statement based migration utility. It's short for migrate.\n\nIt's used in production on several projects, both personal and\nprofessional. The tool provides controlled migrations for production\nenvironments.\n\n- Well tested and used: mysql.\n- Early, but functional: sqlite.\n\nStatus: active use, maintained on occasion.\n\n## Goals\n\n- One way automatic or on-demand SQL migrations,\n- Documentation and Code generation from DB schema\n\nThe intent of the tool is to provide a simple configuration file based\nsetup for database schema and access, so it may be deployed in CI jobs\nand automated for production environments.\n\nAdditionally, it provides schema migrations for the configured databases,\nso the migrations themselves can be tested from CI jobs, and can generate\nsource code and documentation for the final schema.\n\n## Usage\n\n~~~text\nUsage: mig (command) [--flags]\nAvailable commands:\n\n   create     Create database schema SQL\n   migrate    Apply SQL migrations to database\n   docs       Generate markdown docs from DB schema\n   lint       Check schema for best practices and comments\n   gen        Generate source code from DB schema\n   version    Print version\n~~~\n\n## Lint\n\nYou can use mig to \"lint\" your database schema, by default:\n\n- a table must have a comment defined,\n- a column must have a comment defined\n- neither tables nor columns may be prefixed or suffixed with `_`\n- table and column names must not use SQL reserved words\n\n### Column/table names\n\nWhile casing isn't enforced, the encouraged way to name tables and column\nnames is in lowercase, with `_` as a delimiter. In the case of generating\nGo code, \"table_name\" will be generated as `TableName`.\n\n### Comments\n\nIn order to generate documentation and have the database schema readable\nwithout that documentation at hand, comments are enforced on tables and\ncolumns. If a column doesn't have a comment, `mig docs` will convert the\ncolumn name into a readable title.\n\n### Table names\n\nThis rule enforces a thought process where you think about a single\nrecord from a table. For example, if you wanted to use a table called\n`dogs`, a single record of that table is a `dog`. As such, a typed object\nwould be named `Dog`, while a set of dogs would be `[]Dog` (possibly\naliased to `Dogs` in code).\n\nEdge cases: a singular noun may end in a `s`, for example, `bus`. While\nit's particularly up to you, a few suggestions for naming the table\napply:\n\n- `bus_entry`\n- `stats_entry`\n- `statistics_entry`\n\nYou may choose other appropriate suffixes, e.g. `_item`, `_record`,...\n\n### Reserved words\n\nSQL servers reserve quite a few keywords for use in SQL statements, and\nit's bad practice to use them as table or column names. While we can\ngenerally quote table and column names in statements, it's often\npreferable to write simpler sql - if you're not using reserved words,\nthen you don't need to. The linter will warn you if you're using any of\nthem as column names or table names.\n\nIn the most often case, when you have a `type` column in tables, it's\nsuggested that you rename the column to `kind`, `kind_of` or similar.\n\n### Prefix/Suffix relationship tables\n\nThis isn't enforced by the linter, but it's suggested to prefix or suffix\nany relationship tables with `rel_` or `_rel`:\n\n- `rel_company_bus_entry` (preferred)\n- `company_bus_entry_rel`\n\nSame plurality and reserved word rules apply for relationship tables.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-bridget%2Fmig","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgo-bridget%2Fmig","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgo-bridget%2Fmig/lists"}