chore: add derpserver to wsproxy, add proxies to derpmap (#7311)

This commit is contained in:
Dean Sheather
2023-07-26 09:21:04 -07:00
committed by GitHub
parent 70692c2e4e
commit 2f0a9996e7
58 changed files with 3001 additions and 386 deletions

View File

@ -0,0 +1,15 @@
BEGIN;
-- drop any rows that aren't primary replicas
DELETE FROM replicas
WHERE "primary" = false;
ALTER TABLE replicas
DROP COLUMN "primary";
ALTER TABLE workspace_proxies
DROP CONSTRAINT workspace_proxies_region_id_unique,
DROP COLUMN region_id,
DROP COLUMN derp_enabled;
COMMIT;

View File

@ -0,0 +1,13 @@
BEGIN;
ALTER TABLE replicas
ADD COLUMN "primary" boolean NOT NULL DEFAULT true;
ALTER TABLE workspace_proxies
-- Adding a serial to a table without a default value will be filled as you
-- would expect on versions of Postgres >= 9 AFAIK (which we require).
ADD COLUMN region_id serial NOT NULL,
ADD COLUMN derp_enabled boolean NOT NULL DEFAULT true,
ADD CONSTRAINT workspace_proxies_region_id_unique UNIQUE (region_id);
COMMIT;