-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: Avoid ingesting binary and unused data (#241)
* chore: remove ingestion for binary and unused data - Remove the following tables: - public.drand_entries - Remove the Following columns: - public.block_headers ticket - public.block_headers election_proof - public.messages params - public.receipts return closes #204 * fix: Reorder migration to merge to master Co-authored-by: Mike Greenberg <[email protected]>
- Loading branch information
Showing
12 changed files
with
54 additions
and
104 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
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
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
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
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
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,47 @@ | ||
package migrations | ||
|
||
import ( | ||
"github.com/go-pg/migrations/v8" | ||
) | ||
|
||
// 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 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 VIEW chain_visualizer_blocks_view AS | ||
SELECT * FROM block_headers | ||
; | ||
ALTER TABLE public.messages DROP COLUMN params; | ||
ALTER TABLE public.receipts DROP COLUMN return; | ||
`) | ||
|
||
down := batch(` | ||
CREATE TABLE public.drand_entries ( | ||
round bigint NOT NULL, | ||
data bytea NOT NULL | ||
); | ||
-- view depends on ticket and election_proof | ||
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 VIEW chain_visualizer_blocks_view AS | ||
SELECT * FROM block_headers | ||
; | ||
ALTER TABLE public.messages ADD COLUMN params bytea; | ||
ALTER TABLE public.receipts ADD COLUMN return bytea; | ||
`) | ||
|
||
migrations.MustRegisterTx(up, down) | ||
} |
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
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
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
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
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
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