From 9f829a1da2ab95ac43be731534e79e636ff57469 Mon Sep 17 00:00:00 2001 From: Weston Platter Date: Tue, 19 May 2015 22:41:13 -0600 Subject: [PATCH 1/2] migrate. print out error message. --- migrate.go | 1 + 1 file changed, 1 insertion(+) diff --git a/migrate.go b/migrate.go index 20a06da..eeb37c2 100644 --- a/migrate.go +++ b/migrate.go @@ -149,6 +149,7 @@ func migrate(goal, crupath, driver, connStr string) { db, err := sql.Open(driver, connStr) if err != nil { ColorLog("[ERRO] Could not connect to %s: %s\n", driver, connStr) + ColorLog("[ERRO] Error: %v", err.Error()) os.Exit(2) } defer db.Close() From 50ce2204ce7652e09ec5478db3522957e3d28cac Mon Sep 17 00:00:00 2001 From: Weston Platter Date: Tue, 19 May 2015 22:50:13 -0600 Subject: [PATCH 2/2] migrate. changed docs to reference PostgreSQL driver as "postgres" instead of "postgresql" --- migrate.go | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/migrate.go b/migrate.go index eeb37c2..e24f80a 100644 --- a/migrate.go +++ b/migrate.go @@ -31,22 +31,22 @@ var cmdMigrate = &Command{ Long: ` bee migrate [-driver=mysql] [-conn="root:@tcp(127.0.0.1:3306)/test"] run all outstanding migrations - -driver: [mysql | postgresql | sqlite] (default: mysql) + -driver: [mysql | postgres | sqlite] (default: mysql) -conn: the connection string used by the driver, the default is root:@tcp(127.0.0.1:3306)/test bee migrate rollback [-driver=mysql] [-conn="root:@tcp(127.0.0.1:3306)/test"] rollback the last migration operation - -driver: [mysql | postgresql | sqlite] (default: mysql) + -driver: [mysql | postgres | sqlite] (default: mysql) -conn: the connection string used by the driver, the default is root:@tcp(127.0.0.1:3306)/test bee migrate reset [-driver=mysql] [-conn="root:@tcp(127.0.0.1:3306)/test"] rollback all migrations - -driver: [mysql | postgresql | sqlite] (default: mysql) + -driver: [mysql | postgres | sqlite] (default: mysql) -conn: the connection string used by the driver, the default is root:@tcp(127.0.0.1:3306)/test bee migrate refresh [-driver=mysql] [-conn="root:@tcp(127.0.0.1:3306)/test"] rollback all migrations and run them all again - -driver: [mysql | postgresql | sqlite] (default: mysql) + -driver: [mysql | postgres | sqlite] (default: mysql) -conn: the connection string used by the driver, the default is root:@tcp(127.0.0.1:3306)/test `, } @@ -56,7 +56,7 @@ var mConn docValue func init() { cmdMigrate.Run = runMigration - cmdMigrate.Flag.Var(&mDriver, "driver", "database driver: mysql, postgresql, sqlite, etc.") + cmdMigrate.Flag.Var(&mDriver, "driver", "database driver: mysql, postgres, sqlite, etc.") cmdMigrate.Flag.Var(&mConn, "conn", "connection string used by the driver to connect to a database instance") }