Skip to content

Commit

Permalink
fix: Reorder migration to merge to master
Browse files Browse the repository at this point in the history
  • Loading branch information
placer14 committed Nov 19, 2020
1 parent 2a18e12 commit 0cf9ff3
Showing 1 changed file with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,20 @@ import (
"github.com/go-pg/migrations/v8"
)

// Schema version 19 removes unused binary data
// Schema version 20 removes unused binary data

func init() {
up := batch(`
DROP TABLE IF EXISTS public.drand_entries;
-- view depends on ticket and election_proof
DROP MATERIALIZED VIEW IF EXISTS chain_visualizer_blocks_view;
DROP VIEW IF EXISTS chain_visualizer_blocks_view;
ALTER TABLE public.block_headers DROP COLUMN ticket;
ALTER TABLE public.block_headers DROP COLUMN election_proof;
CREATE MATERIALIZED VIEW IF NOT EXISTS chain_visualizer_blocks_view AS
CREATE VIEW chain_visualizer_blocks_view AS
SELECT * FROM block_headers
WITH NO DATA;
;
ALTER TABLE public.messages DROP COLUMN params;
Expand All @@ -30,12 +31,12 @@ func init() {
);
-- view depends on ticket and election_proof
DROP MATERIALIZED VIEW IF EXISTS chain_visualizer_blocks_view;
DROP VIEW IF EXISTS chain_visualizer_blocks_view;
ALTER TABLE public.block_headers ADD COLUMN ticket bytea;
ALTER TABLE public.block_headers ADD COLUMN election_proof bytea;
CREATE MATERIALIZED VIEW IF NOT EXISTS chain_visualizer_blocks_view AS
CREATE VIEW chain_visualizer_blocks_view AS
SELECT * FROM block_headers
WITH NO DATA;
;
ALTER TABLE public.messages ADD COLUMN params bytea;
Expand Down

0 comments on commit 0cf9ff3

Please sign in to comment.