|
| 1 | +-- Deploy travis-logs:logs_create_scan_status to pg |
| 2 | +-- requires: partman_remove_constraint |
| 3 | + |
| 4 | +BEGIN; |
| 5 | + |
| 6 | + SET client_min_messages = WARNING; |
| 7 | + |
| 8 | + ALTER TABLE logs |
| 9 | + ADD COLUMN scan_status character varying, |
| 10 | + ADD COLUMN scan_status_updated_at timestamp without time zone, |
| 11 | + ADD COLUMN censored boolean, |
| 12 | + ADD COLUMN scan_queued_at timestamp without time zone, |
| 13 | + ADD COLUMN scan_started_at timestamp without time zone, |
| 14 | + ADD COLUMN scan_processing_at timestamp without time zone, |
| 15 | + ADD COLUMN scan_finalizing_at timestamp without time zone, |
| 16 | + ADD COLUMN scan_ended_at timestamp without time zone; |
| 17 | + |
| 18 | + CREATE INDEX IF NOT EXISTS index_logs_on_scan_status_order_by_newest ON public.logs USING btree (scan_status, id DESC); |
| 19 | + CREATE INDEX IF NOT EXISTS index_logs_on_scan_status_and_scan_status_updated_at ON public.logs USING btree (scan_status, scan_status_updated_at); |
| 20 | + -- CREATE INDEX IF NOT EXISTS index_logs_on_scan_status_and_scan_status_updated_at_where_running ON public.logs USING btree (scan_status, scan_status_updated_at) WHERE ((scan_status)::text = ANY ((ARRAY['started'::character varying, 'processing'::character varying, 'finalizing'::character varying])::text[])); |
| 21 | + CREATE INDEX IF NOT EXISTS index_logs_on_scan_queued_at ON public.logs USING btree (scan_queued_at); |
| 22 | + CREATE INDEX IF NOT EXISTS index_logs_on_scan_started_at ON public.logs USING btree (scan_started_at); |
| 23 | + CREATE INDEX IF NOT EXISTS index_logs_on_scan_processing_at ON public.logs USING btree (scan_processing_at); |
| 24 | + CREATE INDEX IF NOT EXISTS index_logs_on_scan_finalizing_at ON public.logs USING btree (scan_finalizing_at); |
| 25 | + CREATE INDEX IF NOT EXISTS index_logs_on_scan_ended_at ON public.logs USING btree (scan_ended_at); |
| 26 | + |
| 27 | +COMMIT; |
0 commit comments