mirror of
https://github.com/coder/coder.git
synced 2025-07-15 22:20:27 +00:00
chore: add derpserver to wsproxy, add proxies to derpmap (#7311)
This commit is contained in:
15
coderd/database/migrations/000142_proxy_derp.down.sql
Normal file
15
coderd/database/migrations/000142_proxy_derp.down.sql
Normal 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;
|
13
coderd/database/migrations/000142_proxy_derp.up.sql
Normal file
13
coderd/database/migrations/000142_proxy_derp.up.sql
Normal 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;
|
Reference in New Issue
Block a user