Skip to content

Commit

Permalink
feat: bump cli and migration render tasks
Browse files Browse the repository at this point in the history
  • Loading branch information
aeneasr committed Aug 10, 2020
1 parent 354e8b2 commit 6dcb42a
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 16 deletions.
9 changes: 5 additions & 4 deletions Makefile
Expand Up @@ -13,21 +13,22 @@ GO_DEPENDENCIES = github.com/ory/go-acc \
github.com/golang/mock/mockgen \
github.com/go-swagger/go-swagger/cmd/swagger \
golang.org/x/tools/cmd/goimports \
github.com/ory/cli \
github.com/mikefarah/yq \
github.com/markbates/pkger/cmd/pkger \
github.com/gobuffalo/packr/v2/packr2

define make-go-dependency
# go install is responsible for not re-building when the code hasn't changed
.PHONY: .bin/$(notdir $1)
.bin/$(notdir $1):
.bin/$(notdir $1): go.mod go.sum Makefile
GOBIN=$(PWD)/.bin/ go install $1
endef
$(foreach dep, $(GO_DEPENDENCIES), $(eval $(call make-go-dependency, $(dep))))
$(call make-lint-dependency)

node_modules: package.json
.bin/cli: go.mod go.sum Makefile
go build -o .bin/cli -tags sqlite github.com/ory/cli

node_modules: package.json Makefile
npm ci

docs/node_modules: docs/package.json
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Expand Up @@ -52,7 +52,7 @@ require (
github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826
github.com/op/go-logging v0.0.0-20160315200505-970db520ece7 // indirect
github.com/ory/analytics-go/v4 v4.0.0
github.com/ory/cli v0.0.12
github.com/ory/cli v0.0.24
github.com/ory/dockertest v3.3.5+incompatible
github.com/ory/dockertest/v3 v3.5.4
github.com/ory/go-acc v0.1.0
Expand Down
9 changes: 5 additions & 4 deletions go.sum
Expand Up @@ -75,6 +75,8 @@ github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496 h1:zV3ejI06
github.com/asaskevich/govalidator v0.0.0-20200108200545-475eaeb16496/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg=
github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535 h1:4daAzAu0S6Vi7/lbWECcX0j45yZReDZ56BQsrVBOEEY=
github.com/asaskevich/govalidator v0.0.0-20200428143746-21a406dcc535/go.mod h1:oGkLhpf+kjZl6xBf758TQhh5XrAeiJv/7FRz/2spLIg=
github.com/avast/retry-go v2.6.0+incompatible h1:FelcMrm7Bxacr1/RM8+/eqkDkmVN7tjlsy51dOzB3LI=
github.com/avast/retry-go v2.6.0+incompatible/go.mod h1:XtSnn+n/sHqQIpZ10K1qAevBhOOCWBLXXy3hyiqqBrY=
github.com/aws/aws-sdk-go v1.23.19 h1:QiEkjRHkDXAThgnHKSEC63JwsSjL/jfYUOA2QYFmbSw=
github.com/aws/aws-sdk-go v1.23.19/go.mod h1:KmX6BPdI08NWTb3/sm4ZGu5ShLoqVDhKgpiN924inxo=
github.com/aws/aws-xray-sdk-go v0.9.4/go.mod h1:XtMKdBQfpVut+tJEwI7+dJFRxxRdxHDyVNp2tHXRq04=
Expand Down Expand Up @@ -1039,8 +1041,8 @@ github.com/openzipkin/zipkin-go v0.2.2 h1:nY8Hti+WKaP0cRsSeQ026wU03QsM762XBeCXBb
github.com/openzipkin/zipkin-go v0.2.2/go.mod h1:NaW6tEwdmWMaCDZzg8sh+IBNOxHMPnhQw8ySjnjRyN4=
github.com/ory/analytics-go/v4 v4.0.0 h1:KQ2P00j9dbj4lDC/Albw/zn/scK67041RhqeW5ptsbw=
github.com/ory/analytics-go/v4 v4.0.0/go.mod h1:FMx9cLRD9xN+XevPvZ5FDMfignpmcqPP6FUKnJ9/MmE=
github.com/ory/cli v0.0.12 h1:ct/qYOETvm/UggIuIgwplz9ZahfpTNZg8dYUyYBgHvk=
github.com/ory/cli v0.0.12/go.mod h1:WQ+RPlizyFBLH7zrePdnwd3Ea+PHaJmPSR9TEVSw7zI=
github.com/ory/cli v0.0.24 h1:lPKxJIA45KcCRyt6H/B+gB64UsN/t40Wnte1VJR3WCE=
github.com/ory/cli v0.0.24/go.mod h1:xHQzktVXHdLzLHUZ36PQ0PU67OQgDYfenLQhbfU4KzM=
github.com/ory/dockertest v3.3.5+incompatible h1:iLLK6SQwIhcbrG783Dghaaa3WPzGc+4Emza6EbVUUGA=
github.com/ory/dockertest v3.3.5+incompatible/go.mod h1:1vX4m9wsvi00u5bseYwXaSnhNrne+V0E6LAcBILJdPs=
github.com/ory/dockertest/v3 v3.5.4 h1:rYijlJuraj8D4OgC1DpYpCV8SGXrkviT3RVrjFy7OFc=
Expand Down Expand Up @@ -1080,8 +1082,7 @@ github.com/ory/x v0.0.93/go.mod h1:lfcTaGXpTZs7IEQAW00r9EtTCOxD//SiP5uWtNiz31g=
github.com/ory/x v0.0.110/go.mod h1:DJfkE3GdakhshNhw4zlKoRaL/ozg/lcTahA9OCih2BE=
github.com/ory/x v0.0.127 h1:goEspwhiKRoKRMBb6T6nDiv5L2mMU4EQUGwu90WM+Ao=
github.com/ory/x v0.0.127/go.mod h1:FwUujfFuCj5d+xgLn4fGMYPnzriR5bdAIulFXMtnK0M=
github.com/ory/x v0.0.128 h1:sArBGCH5s+0Zv0jD+t639Vy22URAD6XskBnD9r0+ESk=
github.com/ory/x v0.0.128/go.mod h1:ykx1XOsl9taQtoW2yNvuxl/feEfTfrZTcbY1U7841tI=
github.com/ory/x v0.0.131/go.mod h1:BMzD4kJYW5/GHoBJndjO0lFy7igXz81UfpXzBQplscQ=
github.com/ory/x v0.0.135 h1:QjXkAI181EqrtMVQoYi0quFMOeu32B58HYbZPC1wFzg=
github.com/ory/x v0.0.135/go.mod h1:BMzD4kJYW5/GHoBJndjO0lFy7igXz81UfpXzBQplscQ=
github.com/parnurzeal/gorequest v0.2.15/go.mod h1:3Kh2QUMJoqw3icWAecsyzkpY7UzRfDhbRdTjtNwNiUE=
Expand Down
11 changes: 4 additions & 7 deletions persistence/sql/README.md
Expand Up @@ -4,24 +4,21 @@ To create a new [fizz](https://gobuffalo.io/en/docs/db/fizz/) migration run in t

```
$ name=
$ soda generate fizz -c ./persistence/sql/.soda.yml -p ./persistence/sql/migrations/templates $name $name
$ ory dev pop migration create ./persistence/sql/migrations/templates $name
```

To create SQL migrations, target each database individually and run

```
$ dialect=mysql # or postgres|cockroach|sqlite
$ name=
$ ory dev pop migration create -d=$dialect ./persistence/sql/migrations/templates $name
$ soda generate sql -e mysql -c ./persistence/sql/.soda.yml -p ./persistence/sql/migrations/templates [name]
$ soda generate sql -e sqlite -c ./persistence/sql/.soda.yml -p ./persistence/sql/migrations/templates [name]
$ soda generate sql -e postgres -c ./persistence/sql/.soda.yml -p ./persistence/sql/migrations/templates [name]
$ soda generate sql -e cockroach -c ./persistence/sql/.soda.yml -p ./persistence/sql/migrations/templates [name]
```

or, alternative run

```
$ soda generate sql -c ./persistence/sql/.soda.yml -p ./persistence/sql/migrations/templates
```

and remove the `sqlite` part from the newly generated file to create a SQL migrations that works with all
aforementioned databases.

Expand Down

0 comments on commit 6dcb42a

Please sign in to comment.