41 lines
858 B
Markdown
41 lines
858 B
Markdown
# 模板文件
|
|
|
|
这个目录包含了可以直接复制到你项目中使用的模板文件。
|
|
|
|
## 包含的模板
|
|
|
|
- `migrate/main.go` - 数据库迁移工具模板 ⭐
|
|
- `Dockerfile.example` - Docker 构建示例
|
|
- `docker-compose.example.yml` - Docker Compose 示例
|
|
- `Makefile.example` - Makefile 常用命令示例
|
|
|
|
## 快速使用
|
|
|
|
### 迁移工具模板
|
|
|
|
```bash
|
|
# 1. 复制到你的项目
|
|
mkdir -p cmd/migrate
|
|
cp templates/migrate/main.go cmd/migrate/
|
|
|
|
# 2. 编译
|
|
go build -o bin/migrate cmd/migrate/main.go
|
|
|
|
# 3. 使用
|
|
./bin/migrate up
|
|
./bin/migrate -help
|
|
```
|
|
|
|
### Docker 模板
|
|
|
|
```bash
|
|
# 复制到你的项目根目录
|
|
cp templates/Dockerfile.example Dockerfile
|
|
cp templates/docker-compose.example.yml docker-compose.yml
|
|
cp templates/Makefile.example Makefile
|
|
```
|
|
|
|
## 完整文档
|
|
|
|
详细使用说明请查看:[MIGRATION.md](../MIGRATION.md)
|