# 使用 Homebrew, apt, Nix 安装 sql-migrate

查看 sql-migrate 的安装路径、可执行文件、元数据以及面向 AI 代理工作流的安全说明。

## 安装

```sh
sudo av install brew:sql-migrate
```

其他安装命令:

### macOS

- Homebrew (100%):

```sh
brew install sql-migrate
```

  证据: local Homebrew formula metadata

### Linux

- Debian apt (92%):

```sh
sudo apt install sql-migrate
```

  证据: Debian stable package indexes: sql-migrate from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz

- Nix (92%):

```sh
nix profile install nixpkgs#sql-migrate
```

  证据: nixpkgs package indexes: pkgs/by-name/sq/sql-migrate/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1

## 软件包事实

- **软件包键:** brew:sql-migrate
- **软件包管理器:** Homebrew
- **软件包管理器页面:** <https://formulae.brew.sh/formula/sql-migrate>
- **版本:** 1.8.1
- **来源摘要:** SQL schema migration tool for Go
- **主页:** <https://github.com/rubenv/sql-migrate>
- **仓库:** <https://github.com/rubenv/sql-migrate>
- **许可证:** MIT
- **源码归档:** <https://github.com/rubenv/sql-migrate/archive/refs/tags/v1.8.1.tar.gz>
- **最后更新:** 2026-07-26T04:03:44+02:00
- **已生成:** 2026-08-04T22:13:35+00:00

## 可执行文件

- sql-migrate (cli)
- sql-migrate (别名)

## 构建依赖

- go

## 安装行为

- post-install 钩子: 未定义
- Bottle: 可用 于 arm64_linux, arm64_sequoia, arm64_sonoma, arm64_tahoe, sonoma, x86_64_linux

## 版本和新鲜度

- 页面生成时间: 2026-08-04
- 管理器版本: 1.8.1
- 管理器更新时间: 2026-07-26
- 本地数据: OK
- 上游仓库: https://github.com/rubenv/sql-migrate
- 检测到的最新版本: v1.8.1 (当前)
## 项目历史与用法

sql-migrate is a Go SQL schema migration tool that can be used as either a standalone CLI or an importable Go library. Its README describes it as based on gorp and goose, with migrations written directly in SQL.

### 项目历史

The public GitHub repository was created in September 2014, in the period when Go database tooling was maturing around small command-line programs and libraries. The project kept the classic migration commands: `up`, `down`, `redo`, `status`, and `new`.

### 采用历史

The project accumulated broad package-manager availability in the supplied package facts, including Homebrew, Debian, Ubuntu, and Nix. Its GitHub repository also shows thousands of stars, indicating durable use beyond a single distribution channel.

### 使用方式

As a CLI, sql-migrate reads `dbconfig.yml` by default, selects an environment with `-env`, and applies or rolls back SQL migration files. As a Go library, it can run migrations from memory, a folder, embedded assets, or an HTTP filesystem, which made it useful for Go applications that wanted migration logic inside the binary.

### 为什么软件包爱好者会关心

For package-manager culture, sql-migrate represents the Go tradition of shipping one small static-ish executable that can also serve as a library. Package maintainers care because database migration tools sit in deployment paths, and users often want the exact same binary available in local development, CI, and server provisioning.

### 时间线

- 2014: GitHub repository created.
- 2014: README examples show migration status output and timestamped SQL migration files.
- 2020s: README documents Go module-era installation with `go install ...@latest` for Go 1.18 and later.
- 2026: Repository remained active according to GitHub metadata.

### Related projects

- The README explicitly says sql-migrate is based on gorp and goose and works well with sqlx. It also documents database drivers for SQLite, PostgreSQL, MySQL, MSSQL, and Oracle.

### 来源

- <https://api.github.com/repos/rubenv/sql-migrate>
- <https://github.com/rubenv/sql-migrate#readme>
- <https://pkg.go.dev/github.com/rubenv/sql-migrate>
- source_facts.package-manager


## 安全说明

broad file, network, media, or database tool signal.

- **Geiger 风险:** blue / 中
- broad file, network, media, or database tool signal


## Configuration and credential file locations

These source-backed paths show where this package keeps local settings or durable credentials. Automic Vault can use them as review targets for secret scanning, migration, and command approval.


## Configuration files

- Unix: dbconfig.yml

## Credential files

- Unix: dbconfig.yml
## 源数据库详情

- **Source Database:** Homebrew formula API
- **Tap:** homebrew/core
- **Full Name:** sql-migrate
- **Version Scheme:** 0
- **Revision:** 0
- **Head Version:** HEAD
- **Bottle Stable Root URL:** <https://ghcr.io/v2/homebrew/core>
- **Deprecated:** no
- **Disabled:** no
- **Keg Only:** no
- **URL Keys:** head, stable

## 其他软件包管理器记录

- Debian apt - sql-migrate - 0.0~git20191213.0633851-3+b16: normalized package name match | Debian stable package indexes: sql-migrate from https://deb.debian.org/debian/dists/stable/main/binary-amd64/Packages.xz | SQL schema migration tool for Go (program) | https://github.com/rubenv/sql-migrate
- Nix - sql-migrate: normalized package name match | nixpkgs package indexes: pkgs/by-name/sq/sql-migrate/package.nix from https://api.github.com/repos/NixOS/nixpkgs/git/trees/master?recursive=1
- Ubuntu apt - sql-migrate - 0.0~git20191213.0633851-3build1: normalized package name match | Ubuntu 24.04 LTS package indexes: sql-migrate from https://archive.ubuntu.com/ubuntu/dists/noble/universe/binary-amd64/Packages.gz | SQL schema migration tool for Go (program) | https://github.com/rubenv/sql-migrate


## 相关链接

- [Source-control packages](https://pkg.so/zh-hans/source-control-tools/) - Belongs to a source-control command family.
- [Secret-risk packages](https://pkg.so/zh-hans/secret-risk-packages/) - Has protected-tool coverage, approval-gate, or non-low Geiger security signals.
- [Terminal utility packages](https://pkg.so/zh-hans/terminal-utilities/) - Matched terminal and command-line workflow metadata.
- [Text processing packages](https://pkg.so/zh-hans/text-processing-tools/) - Matched text, document, or structured-data processing metadata.
- [go](https://pkg.so/zh-hans/brew/go/) - Build dependency declared by Homebrew.
- [sql-lint](https://pkg.so/zh-hans/brew/sql-lint/) - Shares pkgdb curated category or tags: cli, database-tools, developer-tools, sql.
- [sqlancer](https://pkg.so/zh-hans/brew/sqlancer/) - Shares pkgdb curated category or tags: cli, database-tools, developer-tools, sql.
- [sql-translator](https://pkg.so/zh-hans/brew/sql-translator/) - Shares pkgdb curated category or tags: cli, database-tools, developer-tools, sql.
- [sqlbench](https://pkg.so/zh-hans/brew/sqlbench/) - Shares pkgdb curated category or tags: cli, database-tools, developer-tools, sql.
- [flyway](https://pkg.so/zh-hans/brew/flyway/) - Shares pkgdb curated category or tags: cli, database-migrations, developer-tools, sql.
- [dbmate](https://pkg.so/zh-hans/brew/dbmate/) - Shares pkgdb curated category or tags: cli, database-migrations, developer-tools, sql.
- [sqlc](https://pkg.so/zh-hans/brew/sqlc/) - Shares pkgdb curated category or tags: cli, developer-tools, go, sql.
- [pspg](https://pkg.so/zh-hans/brew/pspg/) - Shares pkgdb curated category or tags: cli, database-tools, developer-tools.

## Combined YAML source

View the package source record on GitHub. [combined/sql-migrate.yml](https://github.com/mxcl/pkgdb/blob/main/combined/sql-migrate.yml)


## 来源

- pkg.so package database
- Geiger risk classifier
- package-page enrichment
- curated configuration and credential file locations
- curated package history
- package version freshness
- pkgdb category and tag curation
- package relationship graph
- external package-manager database matches
- cross-ecosystem install command graph
