cobramigration

package
v0.0.20 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2025 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package cobramigration: Cobra CLI integration for database migration operations Provides command-line interface for migration execution with user-friendly commands Features version display, batch migration, and step-by-step migration control Integrates seamlessly with golang-migrate for robust migration management

cobramigration: 用于数据库迁移操作的 Cobra CLI 集成 为迁移执行提供命令行接口,具有用户友好的命令 具有版本显示、批量迁移和逐步迁移控制功能 与 golang-migrate 无缝集成,提供稳健的迁移管理

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMigrateCmd

func NewMigrateCmd(getDB func() *gorm.DB, getMigration func(*gorm.DB) *migrate.Migrate) *cobra.Command

NewMigrateCmd creates comprehensive migration command with subcommands for all migration operations Uses lazy initialization - connections created only when command runs (not during command tree building) Migration factory accepts database connection parameter to share single connection (avoiding duplicate connections)

NewMigrateCmd 创建包含子命令的综合迁移命令,用于所有迁移操作 使用延迟初始化 - 仅在命令运行时创建连接(而非命令树构建时) 迁移工厂接受数据库连接参数以共享单个连接(避免重复连接)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL