From 612cb3caa476e6834c09bc9846b03c026e0845f5 Mon Sep 17 00:00:00 2001 From: Stanislas Michalak Date: Sat, 25 Aug 2018 17:08:04 +0200 Subject: [PATCH 1/4] Back to development --- soda/cmd/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soda/cmd/version.go b/soda/cmd/version.go index 230f060e..7523c6dc 100644 --- a/soda/cmd/version.go +++ b/soda/cmd/version.go @@ -1,4 +1,4 @@ package cmd // Version defines the current Pop version. -const Version = "v4.7.0" +const Version = "development" From 81580959c129d716ac93721c324c06de37947e6b Mon Sep 17 00:00:00 2001 From: Stanislas Michalak Date: Mon, 27 Aug 2018 11:12:53 +0200 Subject: [PATCH 2/4] Fix model generator Move missing options to the opts parameter. --- soda/cmd/generate/model_cmd.go | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/soda/cmd/generate/model_cmd.go b/soda/cmd/generate/model_cmd.go index c017865a..79d7f526 100644 --- a/soda/cmd/generate/model_cmd.go +++ b/soda/cmd/generate/model_cmd.go @@ -36,9 +36,10 @@ var ModelCmd = &cobra.Command{ p := cmd.Flag("path") e := cmd.Flag("env") data := map[string]interface{}{ - "marshalType": structTag, - "path": p.Value.String(), - "env": e.Value.String(), + "skipMigration": skipMigration, + "marshalType": structTag, + "path": p.Value.String(), + "env": e.Value.String(), } return Model(args[0], data, args[1:]) }, @@ -82,7 +83,8 @@ func Model(name string, opts map[string]interface{}, attributes []string) error return err } - if skipMigration { + sm, found := opts["skipMigration"].(bool) + if found && sm { return nil } From 50fb19585f237bf691fcedb93498a3d89c8cd0eb Mon Sep 17 00:00:00 2001 From: Stanislas Michalak Date: Mon, 27 Aug 2018 11:33:48 +0200 Subject: [PATCH 3/4] Fix missing migrationType --- soda/cmd/generate/model_cmd.go | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/soda/cmd/generate/model_cmd.go b/soda/cmd/generate/model_cmd.go index 79d7f526..63e92cd0 100644 --- a/soda/cmd/generate/model_cmd.go +++ b/soda/cmd/generate/model_cmd.go @@ -38,6 +38,7 @@ var ModelCmd = &cobra.Command{ data := map[string]interface{}{ "skipMigration": skipMigration, "marshalType": structTag, + "migrationType": migrationType, "path": p.Value.String(), "env": e.Value.String(), } @@ -92,7 +93,12 @@ func Model(name string, opts map[string]interface{}, attributes []string) error if !found { return errors.New("path option is required") } - switch migrationType { + + migrationT, found := opts["migrationType"].(string) + if !found { + return errors.New("migrationType option is required") + } + switch migrationT { case "sql": env, found := opts["env"].(string) if !found { From a134ef806e0ef202d4c34b6f1d7030e4ea21fecc Mon Sep 17 00:00:00 2001 From: Stanislas Michalak Date: Mon, 27 Aug 2018 11:35:18 +0200 Subject: [PATCH 4/4] Revert "Back to development" This reverts commit 612cb3caa476e6834c09bc9846b03c026e0845f5. --- soda/cmd/version.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/soda/cmd/version.go b/soda/cmd/version.go index 7523c6dc..230f060e 100644 --- a/soda/cmd/version.go +++ b/soda/cmd/version.go @@ -1,4 +1,4 @@ package cmd // Version defines the current Pop version. -const Version = "development" +const Version = "v4.7.0"