Skip to content
This repository has been archived by the owner on Apr 2, 2024. It is now read-only.

Commit

Permalink
Fix partial upgrades to 0.6.0
Browse files Browse the repository at this point in the history
This fixes previous updates to 0.6 that were only partially applied.
See issue #755.
  • Loading branch information
cevian committed Oct 12, 2021
1 parent f26bbfe commit ce939ac
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/migrations/migration_files_generated.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions pkg/migrations/sql/versions/dev/0.5.2-dev/1-downsampling.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,18 @@
DO $$
BEGIN
--This fixes previous updates to 0.6 that were only partially applied. See issue #755
--Often this isn't needed and so will error out
ALTER TABLE SCHEMA_CATALOG.metric
DROP COLUMN table_schema,
DROP COLUMN series_table,
DROP COLUMN is_view,
ADD CONSTRAINT "metric_metric_name_table_name_key" UNIQUE(metric_name) INCLUDE (table_name),
ADD CONSTRAINT "metric_table_name_key" UNIQUE(table_name);
EXCEPTION WHEN others THEN --ignore
NULL;
END
$$;

ALTER TABLE SCHEMA_CATALOG.metric
ADD COLUMN table_schema name NOT NULL DEFAULT 'SCHEMA_DATA',
ADD COLUMN series_table name, -- series_table stores the name of the table used to store the series data for this metric.
Expand Down

0 comments on commit ce939ac

Please sign in to comment.