-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
7a282d4
commit 9823385
Showing
3 changed files
with
29 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,6 @@ get-deps: | |
go get -u google.golang.org/protobuf/cmd/protoc-gen-go | ||
go get -u google.golang.org/grpc/cmd/protoc-gen-go-grpc | ||
|
||
|
||
generate: | ||
make generate-chat-api | ||
|
||
|
@@ -41,4 +40,23 @@ docker-build-and-push: | |
# docker-build-and-push: | ||
# docker buildx build --no-cache --platform linux/amd64 -t <REGESTRY>/test-server:v0.0.1 . | ||
# docker login -u <USERNAME> -p <PASSWORD> <REGESTRY> | ||
# docker push <REGESTRY>/test-server:v0.0.1 | ||
# docker push <REGESTRY>/test-server:v0.0.1 | ||
|
||
# Goose functions | ||
|
||
include postgres/.env | ||
|
||
LOCAL_MIGRATION_DIR=$(MIGRATION_DIR) | ||
LOCAL_MIGRATION_DSN="host=localhost port=$(PG_PORT) dbname=$(PG_DB_NAME) user=$(PG_USER) password=$(PG_PASSWORD) sslmode=disable" | ||
|
||
install-goose: | ||
GOBIN=$(LOCAL_BIN) go install github.com/pressly/goose/v3/cmd/[email protected] | ||
|
||
local-migration-status: | ||
${LOCAL_BIN}/goose -dir ${LOCAL_MIGRATION_DIR} postgres ${LOCAL_MIGRATION_DSN} status -v | ||
|
||
local-migration-up: | ||
${LOCAL_BIN}/goose -dir ${LOCAL_MIGRATION_DIR} postgres ${LOCAL_MIGRATION_DSN} up -v | ||
|
||
local-migration-down: | ||
${LOCAL_BIN}/goose -dir ${LOCAL_MIGRATION_DIR} postgres ${LOCAL_MIGRATION_DSN} down -v |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,4 +3,3 @@ PG_USER=chat-user | |
PG_PASSWORD=chat-password | ||
PG_PORT=54321 | ||
MIGRATION_DIR=./migrations | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
-- +goose Up | ||
-- +goose StatementBegin | ||
SELECT 'up SQL query'; | ||
-- +goose StatementEnd | ||
|
||
-- +goose Down | ||
-- +goose StatementBegin | ||
SELECT 'down SQL query'; | ||
-- +goose StatementEnd |