Skip to content

Commit

Permalink
Merge pull request #10366 from vegaprotocol/fix/mark_price_slow_updates
Browse files Browse the repository at this point in the history
fix: slow migration in 0083
  • Loading branch information
EVODelavega authored Jan 10, 2024
2 parents a420c08 + 16a9b84 commit 9370809
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions datanode/sqlstore/migrations/0083_mark_price.sql
Original file line number Diff line number Diff line change
@@ -1,11 +1,12 @@
-- +goose Up
create type composite_price_type as enum('COMPOSITE_PRICE_TYPE_UNSPECIFIED','COMPOSITE_PRICE_TYPE_WEIGHTED','COMPOSITE_PRICE_TYPE_MEDIAN','COMPOSITE_PRICE_TYPE_LAST_TRADE');
alter table market_data add column if not exists mark_price_type composite_price_type;
alter table market_data add column if not exists mark_price_type composite_price_type not null default('COMPOSITE_PRICE_TYPE_LAST_TRADE');
alter table current_market_data add column if not exists mark_price_type composite_price_type;

update market_data set mark_price_type = 'COMPOSITE_PRICE_TYPE_LAST_TRADE';
update current_market_data set mark_price_type = 'COMPOSITE_PRICE_TYPE_LAST_TRADE';

alter table current_market_data alter mark_price_type set not null;

-- +goose StatementBegin
UPDATE proposals
SET terms = jsonb_set(
Expand Down

0 comments on commit 9370809

Please sign in to comment.