Merge pull request #39 from vulcanize/release-v0.3.3

Release v0.3.3
This commit is contained in:
Ian Norden 2022-01-07 13:44:36 -06:00 committed by GitHub
commit 3fb695c1e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
11 changed files with 22 additions and 7 deletions

View File

@ -1,10 +1,14 @@
ifndef GOPATH
override GOPATH = $(HOME)/go
endif
BIN = $(GOPATH)/bin
# Tools
## Migration tool
GOOSE = $(BIN)/goose
$(BIN)/goose:
go get -u github.com/pressly/goose/cmd/goose
GO111MODULE=off go get -u github.com/pressly/goose/cmd/goose
.PHONY: installtools
installtools: | $(GOOSE)
@ -50,6 +54,11 @@ rollback: $(GOOSE) checkdbvars
rollback_to: $(GOOSE) checkmigration checkdbvars
$(GOOSE) -dir db/migrations postgres "$(CONNECT_STRING)" down-to "$(MIGRATION)"
## Apply the next up migration
.PHONY: migrate_up_by_one
migrate_up_by_one: $(GOOSE) checkdbvars
$(GOOSE) -dir db/migrations postgres "$(CONNECT_STRING)" up-by-one
## Apply all migrations not already run
.PHONY: migrate
migrate: $(GOOSE) checkdbvars
@ -61,6 +70,11 @@ migrate: $(GOOSE) checkdbvars
migrate_pre_batch_set: $(GOOSE) checkdbvars
$(GOOSE) -dir db/pre_batch_processing_migrations postgres "$(CONNECT_STRING)" up
## Apply migrations to be ran after a batch processing, one-by-one
.PHONY: migrate_post_batch_set_up_by_one
migrate_post_batch_set_up_by_one: $(GOOSE) checkdbvars
$(GOOSE) -dir db/post_batch_processing_migrations postgres "$(CONNECT_STRING)" up-by-one
## Apply migrations to be ran after a batch processing
.PHONY: migrate_post_batch_set
migrate_post_batch_set: $(GOOSE) checkdbvars

View File

@ -0,0 +1,7 @@
-- +goose Up
ALTER TABLE public.blocks
ADD CONSTRAINT pk_public_blocks PRIMARY KEY (key);
-- +goose Down
ALTER TABLE public.blocks
DROP CONSTRAINT pk_public_blocks;

View File

@ -1,7 +1,4 @@
-- +goose Up
ALTER TABLE public.blocks
ADD CONSTRAINT pk_public_blocks PRIMARY KEY (key);
ALTER TABLE public.nodes
ADD CONSTRAINT pk_public_nodes PRIMARY KEY (node_id);
@ -33,9 +30,6 @@ ALTER TABLE eth.state_accounts
ADD CONSTRAINT pk_eth_state_accounts PRIMARY KEY (header_id, state_path);
-- +goose Down
ALTER TABLE public.blocks
DROP CONSTRAINT pk_public_blocks;
ALTER TABLE public.nodes
DROP CONSTRAINT pk_public_nodes;