Merge pull request #93 from 8thlight/vdb-178-squash-trivial-migrations

[WIP] VDB-178 Squash trivial migrations
This commit is contained in:
Takayuki Goto 2018-11-06 14:30:45 -06:00 committed by GitHub
commit 82e749f550
66 changed files with 144 additions and 150 deletions

View File

@ -0,0 +1,4 @@
DROP TABLE maker.flip_kick;
ALTER TABLE public.checked_headers
DROP COLUMN flip_kick_checked;

View File

@ -13,3 +13,6 @@ CREATE TABLE maker.flip_kick (
raw_log JSONB,
UNIQUE (header_id, tx_idx, log_idx)
);
ALTER TABLE public.checked_headers
ADD COLUMN flip_kick_checked BOOLEAN NOT NULL DEFAULT FALSE;

View File

@ -1 +0,0 @@
DROP TABLE maker.flip_kick;

View File

@ -0,0 +1,4 @@
DROP TABLE maker.frob;
ALTER TABLE public.checked_headers
DROP COLUMN frob_checked;

View File

@ -12,4 +12,7 @@ CREATE TABLE maker.frob (
tx_idx INTEGER NOT NUll,
raw_log JSONB,
UNIQUE (header_id, tx_idx, log_idx)
);
);
ALTER TABLE public.checked_headers
ADD COLUMN frob_checked BOOLEAN NOT NULL DEFAULT FALSE;

View File

@ -1 +0,0 @@
DROP TABLE maker.frob;

View File

@ -0,0 +1,4 @@
DROP TABLE maker.tend;
ALTER TABLE public.checked_headers
DROP COLUMN tend_checked;

View File

@ -1,7 +1,7 @@
CREATE TABLE maker.tend (
id SERIAL PRIMARY KEY,
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
bid_id NUMERIC NOT NULL UNIQUE,
bid_id NUMERIC NOT NULL,
lot NUMERIC,
bid NUMERIC,
guy TEXT,
@ -11,3 +11,6 @@ CREATE TABLE maker.tend (
raw_log JSONB,
UNIQUE (header_id, tx_idx, log_idx)
);
ALTER TABLE public.checked_headers
ADD COLUMN tend_checked BOOLEAN NOT NULL DEFAULT FALSE;

View File

@ -1 +0,0 @@
DROP TABLE maker.tend;

View File

@ -0,0 +1,4 @@
DROP TABLE maker.bite;
ALTER TABLE public.checked_headers
DROP COLUMN bite_checked;

View File

@ -12,4 +12,7 @@ CREATE TABLE maker.bite (
log_idx INTEGER NOT NUll,
raw_log JSONB,
UNIQUE (header_id, tx_idx, log_idx)
)
);
ALTER TABLE public.checked_headers
ADD COLUMN bite_checked BOOLEAN NOT NULL DEFAULT FALSE;

View File

@ -1 +0,0 @@
DROP TABLE maker.bite;

View File

@ -0,0 +1,4 @@
DROP TABLE maker.dent;
ALTER TABLE public.checked_headers
DROP COLUMN dent_checked;

View File

@ -1,7 +1,7 @@
CREATE TABLE maker.dent (
id SERIAL PRIMARY KEY,
header_id INTEGER NOT NULL REFERENCES headers (id) ON DELETE CASCADE,
bid_id NUMERIC NOT NULL UNIQUE,
bid_id NUMERIC NOT NULL,
lot NUMERIC,
bid NUMERIC,
guy BYTEA,
@ -11,3 +11,6 @@ CREATE TABLE maker.dent (
raw_log JSONB,
UNIQUE (header_id, tx_idx, log_idx)
);
ALTER TABLE public.checked_headers
ADD COLUMN dent_checked BOOLEAN NOT NULL DEFAULT FALSE;

View File

@ -1 +0,0 @@
DROP TABLE maker.dent;

View File

@ -0,0 +1,12 @@
DROP TABLE maker.pit_file_ilk;
DROP TABLE maker.pit_file_stability_fee;
DROP TABLE maker.pit_file_debt_ceiling;
ALTER TABLE public.checked_headers
DROP COLUMN pit_file_debt_ceiling_checked;
ALTER TABLE public.checked_headers
DROP COLUMN pit_file_ilk_checked;
ALTER TABLE public.checked_headers
DROP COLUMN pit_file_stability_fee_checked;

View File

@ -30,4 +30,13 @@ CREATE TABLE maker.pit_file_debt_ceiling (
tx_idx INTEGER NOT NULL,
raw_log JSONB,
UNIQUE (header_id, tx_idx, log_idx)
);
);
ALTER TABLE public.checked_headers
ADD COLUMN pit_file_debt_ceiling_checked BOOLEAN NOT NULL DEFAULT FALSE;
ALTER TABLE public.checked_headers
ADD COLUMN pit_file_ilk_checked BOOLEAN NOT NULL DEFAULT FALSE;
ALTER TABLE public.checked_headers
ADD COLUMN pit_file_stability_fee_checked BOOLEAN NOT NULL DEFAULT FALSE;

View File

@ -1,3 +0,0 @@
DROP TABLE maker.pit_file_ilk;
DROP TABLE maker.pit_file_stability_fee;
DROP TABLE maker.pit_file_debt_ceiling;

View File

@ -0,0 +1,4 @@
DROP TABLE maker.vat_init;
ALTER TABLE public.checked_headers
DROP COLUMN vat_init_checked;

View File

@ -6,4 +6,7 @@ CREATE TABLE maker.vat_init (
tx_idx INTEGER NOT NUll,
raw_log JSONB,
UNIQUE (header_id, tx_idx, log_idx)
);
);
ALTER TABLE public.checked_headers
ADD COLUMN vat_init_checked BOOLEAN NOT NULL DEFAULT FALSE;

View File

@ -1 +0,0 @@
DROP TABLE maker.vat_init;

View File

@ -0,0 +1,12 @@
DROP TABLE maker.drip_file_ilk;
DROP TABLE maker.drip_file_repo;
DROP TABLE maker.drip_file_vow;
ALTER TABLE public.checked_headers
DROP COLUMN drip_file_ilk_checked;
ALTER TABLE public.checked_headers
DROP COLUMN drip_file_repo_checked;
ALTER TABLE public.checked_headers
DROP COLUMN drip_file_vow_checked;

View File

@ -30,4 +30,13 @@ CREATE TABLE maker.drip_file_vow (
tx_idx INTEGER NOT NULL,
raw_log JSONB,
UNIQUE (header_id, tx_idx, log_idx)
);
);
ALTER TABLE public.checked_headers
ADD COLUMN drip_file_ilk_checked BOOLEAN NOT NULL DEFAULT FALSE;
ALTER TABLE public.checked_headers
ADD COLUMN drip_file_repo_checked BOOLEAN NOT NULL DEFAULT FALSE;
ALTER TABLE public.checked_headers
ADD COLUMN drip_file_vow_checked BOOLEAN NOT NULL DEFAULT FALSE;

View File

@ -1,3 +0,0 @@
DROP TABLE maker.drip_file_ilk;
DROP TABLE maker.drip_file_repo;
DROP TABLE maker.drip_file_vow;

View File

@ -0,0 +1,4 @@
DROP TABLE maker.deal;
ALTER TABLE public.checked_headers
DROP COLUMN deal_checked;

View File

@ -7,4 +7,7 @@ CREATE TABLE maker.deal (
tx_idx INTEGER NOT NUll,
raw_log JSONB,
UNIQUE (header_id, tx_idx, log_idx)
);
);
ALTER TABLE public.checked_headers
ADD COLUMN deal_checked BOOLEAN NOT NULL DEFAULT FALSE;

View File

@ -1 +0,0 @@
DROP TABLE maker.deal;

View File

@ -2,7 +2,8 @@ CREATE OR REPLACE FUNCTION notify_pricefeed() RETURNS trigger AS $$
BEGIN
PERFORM pg_notify(
CAST('postgraphile:price_feed' AS text),
row_to_json(NEW)::text);
json_build_object('__node__', json_build_array('price_feeds', NEW.id))::text
);
RETURN NEW;
END;
$$ LANGUAGE plpgsql;

View File

@ -0,0 +1,4 @@
DROP TABLE maker.drip_drip;
ALTER TABLE public.checked_headers
DROP COLUMN drip_drip_checked;

View File

@ -6,4 +6,7 @@ CREATE TABLE maker.drip_drip (
tx_idx INTEGER NOT NUll,
raw_log JSONB,
UNIQUE (header_id, tx_idx, log_idx)
);
);
ALTER TABLE public.checked_headers
ADD COLUMN drip_drip_checked BOOLEAN NOT NULL DEFAULT FALSE;

View File

@ -1 +0,0 @@
DROP TABLE maker.drip_drip;

View File

@ -0,0 +1,12 @@
DROP TABLE maker.cat_file_chop_lump;
DROP TABLE maker.cat_file_flip;
DROP TABLE maker.cat_file_pit_vow;
ALTER TABLE public.checked_headers
DROP COLUMN cat_file_chop_lump_checked;
ALTER TABLE public.checked_headers
DROP COLUMN cat_file_flip_checked;
ALTER TABLE public.checked_headers
DROP COLUMN cat_file_pit_vow_checked;

View File

@ -31,4 +31,13 @@ CREATE TABLE maker.cat_file_pit_vow (
log_idx INTEGER NOT NULL,
raw_log JSONB,
UNIQUE (header_id, tx_idx, log_idx)
);
);
ALTER TABLE public.checked_headers
ADD COLUMN cat_file_chop_lump_checked BOOLEAN NOT NULL DEFAULT FALSE;
ALTER TABLE public.checked_headers
ADD COLUMN cat_file_flip_checked BOOLEAN NOT NULL DEFAULT FALSE;
ALTER TABLE public.checked_headers
ADD COLUMN cat_file_pit_vow_checked BOOLEAN NOT NULL DEFAULT FALSE;

View File

@ -1,3 +0,0 @@
DROP TABLE maker.cat_file_chop_lump;
DROP TABLE maker.cat_file_flip;
DROP TABLE maker.cat_file_pit_vow;

View File

@ -1,2 +0,0 @@
ALTER TABLE public.checked_headers
DROP COLUMN deal_checked;

View File

@ -1,2 +0,0 @@
ALTER TABLE public.checked_headers
ADD COLUMN deal_checked BOOLEAN NOT NULL DEFAULT FALSE;

View File

@ -1,2 +0,0 @@
ALTER TABLE public.checked_headers
DROP COLUMN dent_checked;

View File

@ -1,2 +0,0 @@
ALTER TABLE public.checked_headers
ADD COLUMN dent_checked BOOLEAN NOT NULL DEFAULT FALSE;

View File

@ -1,2 +0,0 @@
ALTER TABLE public.checked_headers
DROP COLUMN flip_kick_checked;

View File

@ -1,2 +0,0 @@
ALTER TABLE public.checked_headers
ADD COLUMN flip_kick_checked BOOLEAN NOT NULL DEFAULT FALSE;

View File

@ -1,2 +0,0 @@
ALTER TABLE public.checked_headers
DROP COLUMN tend_checked;

View File

@ -1,2 +0,0 @@
ALTER TABLE public.checked_headers
ADD COLUMN tend_checked BOOLEAN NOT NULL DEFAULT FALSE;

View File

@ -1,6 +0,0 @@
ALTER TABLE public.checked_headers
DROP COLUMN cat_file_chop_lump_checked;
ALTER TABLE public.checked_headers
DROP COLUMN cat_file_flip_checked;
ALTER TABLE public.checked_headers
DROP COLUMN cat_file_pit_vow_checked;

View File

@ -1,6 +0,0 @@
ALTER TABLE public.checked_headers
ADD COLUMN cat_file_chop_lump_checked BOOLEAN NOT NULL DEFAULT FALSE;
ALTER TABLE public.checked_headers
ADD COLUMN cat_file_flip_checked BOOLEAN NOT NULL DEFAULT FALSE;
ALTER TABLE public.checked_headers
ADD COLUMN cat_file_pit_vow_checked BOOLEAN NOT NULL DEFAULT FALSE;

View File

@ -1,15 +0,0 @@
DROP TRIGGER notify_pricefeeds ON maker.price_feeds;
CREATE OR REPLACE FUNCTION notify_pricefeed() RETURNS trigger AS $$
BEGIN
PERFORM pg_notify(
CAST('postgraphile:price_feed' AS text),
row_to_json(NEW)::text);
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
CREATE TRIGGER notify_pricefeeds
AFTER INSERT ON maker.price_feeds
FOR EACH ROW
EXECUTE PROCEDURE notify_pricefeed();

View File

@ -1,16 +0,0 @@
DROP TRIGGER notify_pricefeeds ON maker.price_feeds;
CREATE OR REPLACE FUNCTION notify_pricefeed() RETURNS trigger AS $$
BEGIN
PERFORM pg_notify(
CAST('postgraphile:price_feed' AS text),
json_build_object('__node__', json_build_array('price_feeds', NEW.id))::text
);
RETURN NEW;
END;
$$ LANGUAGE plpgsql;
CREATE TRIGGER notify_pricefeeds
AFTER INSERT ON maker.price_feeds
FOR EACH ROW
EXECUTE PROCEDURE notify_pricefeed();

View File

@ -1,2 +0,0 @@
ALTER TABLE public.checked_headers
DROP COLUMN bite_checked;

View File

@ -1,2 +0,0 @@
ALTER TABLE public.checked_headers
ADD COLUMN bite_checked BOOLEAN NOT NULL DEFAULT FALSE;

View File

@ -1,2 +0,0 @@
ALTER TABLE public.checked_headers
DROP COLUMN drip_drip_checked;

View File

@ -1,2 +0,0 @@
ALTER TABLE public.checked_headers
ADD COLUMN drip_drip_checked BOOLEAN NOT NULL DEFAULT FALSE;

View File

@ -1,6 +0,0 @@
ALTER TABLE public.checked_headers
DROP COLUMN drip_file_ilk_checked;
ALTER TABLE public.checked_headers
DROP COLUMN drip_file_repo_checked;
ALTER TABLE public.checked_headers
DROP COLUMN drip_file_vow_checked;

View File

@ -1,6 +0,0 @@
ALTER TABLE public.checked_headers
ADD COLUMN drip_file_ilk_checked BOOLEAN NOT NULL DEFAULT FALSE;
ALTER TABLE public.checked_headers
ADD COLUMN drip_file_repo_checked BOOLEAN NOT NULL DEFAULT FALSE;
ALTER TABLE public.checked_headers
ADD COLUMN drip_file_vow_checked BOOLEAN NOT NULL DEFAULT FALSE;

View File

@ -1,2 +0,0 @@
ALTER TABLE public.checked_headers
DROP COLUMN frob_checked;

View File

@ -1,2 +0,0 @@
ALTER TABLE public.checked_headers
ADD COLUMN frob_checked BOOLEAN NOT NULL DEFAULT FALSE;

View File

@ -1,6 +0,0 @@
ALTER TABLE public.checked_headers
DROP COLUMN pit_file_debt_ceiling_checked;
ALTER TABLE public.checked_headers
DROP COLUMN pit_file_ilk_checked;
ALTER TABLE public.checked_headers
DROP COLUMN pit_file_stability_fee_checked;

View File

@ -1,6 +0,0 @@
ALTER TABLE public.checked_headers
ADD COLUMN pit_file_debt_ceiling_checked BOOLEAN NOT NULL DEFAULT FALSE;
ALTER TABLE public.checked_headers
ADD COLUMN pit_file_ilk_checked BOOLEAN NOT NULL DEFAULT FALSE;
ALTER TABLE public.checked_headers
ADD COLUMN pit_file_stability_fee_checked BOOLEAN NOT NULL DEFAULT FALSE;

View File

@ -1,2 +0,0 @@
ALTER TABLE public.checked_headers
DROP COLUMN vat_init_checked;

View File

@ -1,2 +0,0 @@
ALTER TABLE public.checked_headers
ADD COLUMN vat_init_checked BOOLEAN NOT NULL DEFAULT FALSE;

View File

@ -1,5 +0,0 @@
ALTER TABLE maker.tend
add constraint tend_bid_id_key unique (bid_id);
ALTER TABLE maker.dent
add constraint dent_bid_id_key unique (bid_id);

View File

@ -1,5 +0,0 @@
ALTER TABLE maker.tend
drop constraint tend_bid_id_key;
ALTER TABLE maker.dent
drop constraint dent_bid_id_key;

View File

@ -1,3 +1,3 @@
DROP TABLE maker.vat_heal;
ALTER TABLE public.checked_headers
DROP COLUMN vat_heal_checked BOOLEAN NOT NULL DEFAULT FALSE;
DROP COLUMN vat_heal_checked;

View File

@ -1161,24 +1161,24 @@ CREATE TABLE public.checked_headers (
id integer NOT NULL,
header_id integer NOT NULL,
price_feeds_checked boolean DEFAULT false NOT NULL,
flop_kick_checked boolean DEFAULT false NOT NULL,
deal_checked boolean DEFAULT false NOT NULL,
dent_checked boolean DEFAULT false NOT NULL,
flip_kick_checked boolean DEFAULT false NOT NULL,
tend_checked boolean DEFAULT false NOT NULL,
cat_file_chop_lump_checked boolean DEFAULT false NOT NULL,
cat_file_flip_checked boolean DEFAULT false NOT NULL,
cat_file_pit_vow_checked boolean DEFAULT false NOT NULL,
bite_checked boolean DEFAULT false NOT NULL,
drip_drip_checked boolean DEFAULT false NOT NULL,
drip_file_ilk_checked boolean DEFAULT false NOT NULL,
drip_file_repo_checked boolean DEFAULT false NOT NULL,
drip_file_vow_checked boolean DEFAULT false NOT NULL,
frob_checked boolean DEFAULT false NOT NULL,
tend_checked boolean DEFAULT false NOT NULL,
bite_checked boolean DEFAULT false NOT NULL,
dent_checked boolean DEFAULT false NOT NULL,
pit_file_debt_ceiling_checked boolean DEFAULT false NOT NULL,
pit_file_ilk_checked boolean DEFAULT false NOT NULL,
pit_file_stability_fee_checked boolean DEFAULT false NOT NULL,
vat_init_checked boolean DEFAULT false NOT NULL,
drip_file_ilk_checked boolean DEFAULT false NOT NULL,
drip_file_repo_checked boolean DEFAULT false NOT NULL,
drip_file_vow_checked boolean DEFAULT false NOT NULL,
deal_checked boolean DEFAULT false NOT NULL,
drip_drip_checked boolean DEFAULT false NOT NULL,
cat_file_chop_lump_checked boolean DEFAULT false NOT NULL,
cat_file_flip_checked boolean DEFAULT false NOT NULL,
cat_file_pit_vow_checked boolean DEFAULT false NOT NULL,
flop_kick_checked boolean DEFAULT false NOT NULL,
vat_move_checked boolean DEFAULT false NOT NULL,
vat_fold_checked boolean DEFAULT false NOT NULL,
vat_heal_checked boolean DEFAULT false NOT NULL,