init comment-service

This commit is contained in:
2023-09-27 16:05:24 +01:00
parent 0ae3ee3af4
commit 55a533c461
41 changed files with 2800 additions and 0 deletions

View File

@@ -0,0 +1,12 @@
migration-new:
migrate create -ext sql -dir ./comment_service/postgres/migrations -seq ${MIGRATION_NAME}
migration-upgrade:
docker run -v "${SERVICE_DIR}/comment_service/postgres/migrations:/migrations" --network host migrate/migrate:4 -path=/migrations/ -database postgresql://${POSTGRES_USER}:${POSTGRES_PASS}@${POSTGRES_HOST}/${POSTGRES_DATABASE}?sslmode=disable up
migration-downgrade:
docker run -v "${SERVICE_DIR}/comment_service/postgres/migrations:/migrations" --network host migrate/migrate:4 -path=/migrations/ -database postgresql://${POSTGRES_USER}:${POSTGRES_PASS}@${POSTGRES_HOST}/${POSTGRES_DATABASE}?sslmode=disable down
protobufs-compile:
poetry run python -m grpc_tools.protoc -I../../protobufs --python_out=./comment_service/models/proto --pyi_out=./comment_service/models/proto --grpc_python_out=./comment_service/models/proto comment.proto post.proto user.proto
poetry run python -m protoletariat --dont-create-package --in-place --python-out ./comment_service/models/proto protoc --proto-path=../../protobufs comment.proto post.proto user.proto