Documentation ¶
Index ¶
- Constants
- Variables
- func MigrateRefresh(currpath, driver, connStr, dir string)
- func MigrateReset(currpath, driver, connStr, dir string)
- func MigrateRollback(currpath, driver, connStr, dir string)
- func MigrateUpdate(currpath, driver, connStr, dir string)
- func RunMigration(cmd *commands.Command, args []string) int
Constants ¶
View Source
const ( // MigrationMainTPL migration main template MigrationMainTPL = `` /* 648-byte string literal not displayed */ // MYSQLMigrationDDL MySQL migration SQL MYSQLMigrationDDL = `` /* 621-byte string literal not displayed */ // POSTGRESMigrationDDL Postgres migration SQL POSTGRESMigrationDDL = `` /* 286-byte string literal not displayed */ )
Variables ¶
View Source
var CmdMigrate = &commands.Command{ UsageLine: "migrate [Command]", Short: "Runs database migrations", Long: `The command 'migrate' allows you to run database migrations to keep it up-to-date. ▶ {{"To run all the migrations:"|bold}} $ radical migrate [-driver=mysql] [-conn="root:@tcp(127.0.0.1:3306)/test"] [-dir="path/to/migration"] ▶ {{"To rollback the last migration:"|bold}} $ radical migrate rollback [-driver=mysql] [-conn="root:@tcp(127.0.0.1:3306)/test"] [-dir="path/to/migration"] ▶ {{"To do a reset, which will rollback all the migrations:"|bold}} $ radical migrate reset [-driver=mysql] [-conn="root:@tcp(127.0.0.1:3306)/test"] [-dir="path/to/migration"] ▶ {{"To update your schema:"|bold}} $ radical migrate refresh [-driver=mysql] [-conn="root:@tcp(127.0.0.1:3306)/test"] [-dir="path/to/migration"] `, PreRun: func(cmd *commands.Command, args []string) { version.ShowShortVersionBanner() }, Run: RunMigration, }
Functions ¶
func MigrateRefresh ¶
func MigrateRefresh(currpath, driver, connStr, dir string)
MigrateRefresh rolls back all migrations and start over again
func MigrateReset ¶
func MigrateReset(currpath, driver, connStr, dir string)
MigrateReset rolls back all migrations
func MigrateRollback ¶
func MigrateRollback(currpath, driver, connStr, dir string)
MigrateRollback rolls back the latest migration
func MigrateUpdate ¶
func MigrateUpdate(currpath, driver, connStr, dir string)
MigrateUpdate does the schema update
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.