Skip to content

Commit

Permalink
added 'generate-migrations' makefile command to generate migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
zeeshanakram3 committed Jan 8, 2024
1 parent 7822391 commit ac20729
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,18 @@ migrate:
dbgen:
@npx squid-typeorm-migration generate

generate-migrations:
@rm db/migrations/*-Data.js || true
@docker run -d --name temp_migrations_db \
-e POSTGRES_DB=squid \
-e POSTGRES_HOST_AUTH_METHOD=trust \
-v temp_migrations_db_volume:/var/lib/postgresql/data \
-v ./db/postgres.conf:/etc/postgresql/postgresql.conf \
-p 5555:5555 postgres:14 postgres -p 5555 || true
@export DB_PORT=5555 && sleep 5 && npx squid-typeorm-migration generate
@docker rm temp_migrations_db -vf || true
@docker volume rm temp_migrations_db_volume || true

codegen:
@npm run generate:schema || true
@npx squid-typeorm-codegen
Expand All @@ -31,7 +43,7 @@ codegen:
typegen:
@npx squid-substrate-typegen typegen.json

prepare: install codegen build
prepare: install typegen codegen build

up-squid:
@docker network create joystream_default || true
Expand Down

0 comments on commit ac20729

Please sign in to comment.